Better splitting

This commit is contained in:
2024-07-26 01:47:15 +02:00
parent 7665b7185d
commit 103b93184f
17 changed files with 95 additions and 97 deletions
Binary file not shown.
+9 -5
View File
@@ -9,19 +9,23 @@ export default defineConfig({
build: {
outDir: '../dist',
emptyOutDir: true,
sourcemap: true,
// sourcemap: true,
rollupOptions: {
output: {
manualChunks: (id) => {
const segments = id.split('node_modules');
const cleanID = segments[segments.length - 1];
console.log('ID', cleanID);
if (id.includes('node_modules')) {
if (id.includes('@mui/') || id.includes('@emotion')) {
if (cleanID.includes('@mui/') || cleanID.includes('@emotion')) {
return 'vendor_mui';
}
if (id.includes('@tanstack')) {
if (cleanID.includes('@tanstack')) {
return 'vendor_tanstack';
}
if (id.includes('react')) {
return 'vendor_1_react';
if (cleanID.includes('react')) {
return 'vendor_react';
}
return 'vendor'; // all other package goes here