Better splitting
This commit is contained in:
Binary file not shown.
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user