perf: split stats app bundles by route

This commit is contained in:
2026-03-18 00:05:51 -07:00
parent a5b1c0509d
commit 61e1621137
3 changed files with 171 additions and 59 deletions

View File

@@ -8,5 +8,25 @@ export default defineConfig({
build: {
outDir: 'dist',
emptyOutDir: true,
rollupOptions: {
output: {
manualChunks(id) {
const normalized = id.replaceAll('\\', '/');
if (
normalized.includes('/node_modules/react-dom/') ||
normalized.includes('/node_modules/react/')
) {
return 'react-vendor';
}
if (normalized.includes('/node_modules/recharts/')) {
return 'charts-vendor';
}
return undefined;
},
},
},
},
});