mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
more optimizations, see if it makes a difference
This commit is contained in:
@@ -281,11 +281,12 @@ export default defineConfig(
|
|||||||
},
|
},
|
||||||
|
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
// Enable tree shaking
|
// Enable aggressive tree shaking
|
||||||
treeshake: {
|
treeshake: {
|
||||||
moduleSideEffects: false,
|
moduleSideEffects: false,
|
||||||
propertyReadSideEffects: false,
|
propertyReadSideEffects: false,
|
||||||
tryCatchDeoptimization: false
|
tryCatchDeoptimization: false,
|
||||||
|
unknownGlobalSideEffects: false
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
// Optimize chunk naming for better caching
|
// Optimize chunk naming for better caching
|
||||||
@@ -301,6 +302,24 @@ export default defineConfig(
|
|||||||
if (id.includes('preact')) {
|
if (id.includes('preact')) {
|
||||||
return '@preact';
|
return '@preact';
|
||||||
}
|
}
|
||||||
|
if (id.includes('@mui/material')) {
|
||||||
|
return '@mui-material';
|
||||||
|
}
|
||||||
|
if (id.includes('@mui/icons-material')) {
|
||||||
|
return '@mui-icons';
|
||||||
|
}
|
||||||
|
if (id.includes('alova')) {
|
||||||
|
return '@alova';
|
||||||
|
}
|
||||||
|
if (id.includes('typesafe-i18n')) {
|
||||||
|
return '@i18n';
|
||||||
|
}
|
||||||
|
if (id.includes('react-toastify')) {
|
||||||
|
return '@toastify';
|
||||||
|
}
|
||||||
|
if (id.includes('@table-library')) {
|
||||||
|
return '@table-library';
|
||||||
|
}
|
||||||
if (id.includes('uuid')) {
|
if (id.includes('uuid')) {
|
||||||
return '@uuid';
|
return '@uuid';
|
||||||
}
|
}
|
||||||
@@ -316,8 +335,14 @@ export default defineConfig(
|
|||||||
if (id.includes('components/')) {
|
if (id.includes('components/')) {
|
||||||
return 'components';
|
return 'components';
|
||||||
}
|
}
|
||||||
if (id.includes('pages/') || id.includes('routes/')) {
|
if (id.includes('app/')) {
|
||||||
return 'pages';
|
return 'app';
|
||||||
|
}
|
||||||
|
if (id.includes('utils/')) {
|
||||||
|
return 'utils';
|
||||||
|
}
|
||||||
|
if (id.includes('api/')) {
|
||||||
|
return 'api';
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user