This commit is contained in:
zwgczx committed 2026-03-02 18:12:32 +08:00
1 parent a10359f7e0
commit 62546bc937
5 files changed
+107 -22

No files matched your search

+21 -5
View File
@@ -29,11 +29,27 @@ export default defineConfig({
entryFileNames: 'static/js/[name]-[hash].js',
// 自定义 css 文件名
assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
// 拆分第三方依赖(如 vue、axios 单独打包)
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString();
}
codeSplitting: {
minSize: 20 * 1024,
groups: [
{
name: 'vendor-ag-grid',
test: /node_modules[\\/](ag-grid-community|ag-grid-enterprise|ag-grid-vue3|@ag-grid-community)[\\/]/,
priority: 30,
entriesAware: true,
maxSize: 450 * 1024
},
{
name: 'vendor-vue',
test: /node_modules[\\/](vue|pinia|@vue|pinia-plugin-persistedstate)[\\/]/,
priority: 20
},
{
name: 'vendor-ui',
test: /node_modules[\\/](reka-ui|@floating-ui|lucide-vue-next|@iconify[\\/]vue)[\\/]/,
priority: 10
}
]
}
}
},