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, sourcemap: false,
rollupOptions: { rollupOptions: {
output: { output: {
manualChunks: { manualChunks(id) {
'element-plus': ['element-plus'], // Let Vite handle chunking automatically to avoid circular dependencies
'vue-vendor': ['vue', 'vue-router', 'pinia'], // 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'
}
}, },
}, },
}, },