mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-03 07:26:45 +00:00
Webpack优化动态主题加载
This commit is contained in:
@@ -2,6 +2,9 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
||||
enabled: process.env.ANALYZE === 'true'
|
||||
})
|
||||
|
||||
const { THEME } = require('./blog.config')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = withBundleAnalyzer({
|
||||
images: {
|
||||
// 图片压缩
|
||||
@@ -64,6 +67,10 @@ module.exports = withBundleAnalyzer({
|
||||
// 'react-dom': 'preact/compat'
|
||||
// })
|
||||
// }
|
||||
|
||||
// 动态主题:添加 resolve.alias 配置,将动态路径映射到实际路径
|
||||
config.resolve.alias['@theme-components'] = path.resolve(__dirname, 'themes', THEME)
|
||||
|
||||
return config
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user