Better splitting
This commit is contained in:
1 parent
7665b7185d
commit
103b93184f
17 files changed
+95
-97
No files matched your search
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