Skip to content

Commit 53cef8b

Browse files
committed
【代码优化】echarts 独立 chunk 打包
1 parent fb08357 commit 53cef8b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

vite.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
7171
drop_debugger: env.VITE_DROP_DEBUGGER === 'true',
7272
drop_console: env.VITE_DROP_CONSOLE === 'true'
7373
}
74-
}
74+
},
75+
rollupOptions: {
76+
output: {
77+
manualChunks: {
78+
echarts: ['echarts'] // 将 echarts 单独打包,参考 https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues/IAB1SX 讨论
79+
}
80+
},
81+
},
7582
},
7683
optimizeDeps: { include, exclude }
7784
}

0 commit comments

Comments
 (0)