fix(admin): 修复生产包分页样式缺失与分包循环依赖

This commit is contained in:
Zhou Weidong committed 2026-11-17 15:13:37 +08:00
1 parent ae9ed6c2b9
commit 716edc2c9f
2 files changed
+7 -3

No files matched your search

+4 -2
View File
@@ -106,10 +106,12 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
rollupOptions: {
plugins: env.VITE_USE_BUNDLE_ANALYZER === 'true' ? [visualizer()] : undefined,
// 拆包
// element-plus 必须与 vue 同块:它内部直接引用 vue 的运行时导出,
// 拆成两块会形成 element-plus ⇄ vue-chunks 循环依赖,浏览器里报
// "Cannot access 'xx' before initialization" 白屏。
output: {
manualChunks: {
'vue-chunks': ['vue', 'vue-router', 'pinia', 'vue-i18n'],
'element-plus': ['element-plus'],
'vue-chunks': ['vue', 'vue-router', 'pinia', 'vue-i18n', 'element-plus'],
'wang-editor': ['@wangeditor/editor', '@wangeditor/editor-for-vue']
}
}