From 53cef8b4751196f354876a37aec1453553bfbec6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 8 Aug 2024 09:35:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91echarts=20=E7=8B=AC=E7=AB=8B=20chunk=20=E6=89=93?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 8cba9150..6ee45630 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -71,7 +71,14 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { drop_debugger: env.VITE_DROP_DEBUGGER === 'true', drop_console: env.VITE_DROP_CONSOLE === 'true' } - } + }, + rollupOptions: { + output: { + manualChunks: { + echarts: ['echarts'] // 将 echarts 单独打包,参考 https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues/IAB1SX 讨论 + } + }, + }, }, optimizeDeps: { include, exclude } }