build:合并css文件、增加分包配置示例

This commit is contained in:
妙码生花 2022-10-25 19:11:13 +08:00
parent 6b3a8da1dc
commit 625fc35f71

View File

@ -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: {