mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-21 12:11:28 -07:00
perf: split stats app bundles by route
This commit is contained in:
@@ -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;
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user