diff --git a/web/vite.config.ts b/web/vite.config.ts index 6fa9a177..a933e60b 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -40,10 +40,20 @@ const viteConfig = ({ mode }: ConfigEnv): UserConfig => { proxy: proxy, }, build: { + cssCodeSplit: false, sourcemap: false, outDir: VITE_OUT_DIR, emptyOutDir: true, chunkSizeWarningLimit: 1500, + rollupOptions: { + output: { + manualChunks: { + // 分包配置,配置完成自动按需加载 + vue: ['vue', 'vue-router', 'pinia', 'vue-i18n', 'element-plus'], + echarts: ['echarts'], + }, + }, + }, }, css: { postcss: {