build: improve manual chunking for better dependency management

This commit is contained in:
2026-01-02 12:27:53 +08:00
parent 434815fd42
commit 08e894c9ae
+10 -3
View File
@@ -28,9 +28,16 @@ export default defineConfig({
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
'element-plus': ['element-plus'],
'vue-vendor': ['vue', 'vue-router', 'pinia'],
manualChunks(id) {
// Let Vite handle chunking automatically to avoid circular dependencies
// Element Plus will be bundled with its dependencies in the correct order
if (id.includes('node_modules')) {
if (id.includes('element-plus')) {
return 'element-plus'
}
// Group all other vendor code together
return 'vendor'
}
},
},
},