u
This commit is contained in:
@@ -162,24 +162,62 @@ export default defineConfig(({ command }) => ({
|
||||
output: {
|
||||
codeSplitting: {
|
||||
groups: [
|
||||
// Split the lazy routes into a handful of per-section chunks
|
||||
// (not one tiny chunk per route). Each section chunk groups the
|
||||
// section's pages together with the component trees used only by
|
||||
// that section, so first navigation to /artikel, /auftrag, …
|
||||
// loads just that section's code. Modules shared across sections
|
||||
// (api/, automats/, utils/, generic components/) fall out into a
|
||||
// common chunk by the bundler automatically.
|
||||
{
|
||||
// Consolidate every lazy(() => import('./pages/...')) route
|
||||
// module into ONE chunk so we don't ship ~30 tiny 0.1–0.4 kB
|
||||
// files. Still loaded on first route navigation (not on the
|
||||
// initial bundle). For per-section chunks instead, replace this
|
||||
// with groups matching /\/src\/pages\/(artikel|lieferung|...)\//.
|
||||
name: 'routes',
|
||||
test: /\/src\/pages\//,
|
||||
// Artikel section: pages + its dedicated component trees.
|
||||
name: 'routes-artikel',
|
||||
test: /\/src\/(pages\/artikel|components\/(article|category|tiles))\//,
|
||||
},
|
||||
{
|
||||
// Delivery + order (auftrag) editor surfaces share these.
|
||||
name: 'routes-manifest',
|
||||
test: /\/src\/components\/manifest\//,
|
||||
},
|
||||
{
|
||||
name: 'routes-auftrag',
|
||||
test: /\/src\/pages\/auftrag\//,
|
||||
},
|
||||
{
|
||||
name: 'routes-lieferung',
|
||||
test: /\/src\/pages\/lieferung\//,
|
||||
},
|
||||
{
|
||||
name: 'routes-kunde',
|
||||
test: /\/src\/pages\/kunde\//,
|
||||
},
|
||||
{
|
||||
priority: 110,
|
||||
name: 'router-vendor',
|
||||
test: /node_modules\/(react-router|react-router-dom)\//,
|
||||
},
|
||||
{
|
||||
priority: 100,
|
||||
name: 'react-vendor',
|
||||
test: /node_modules\/(react|react-dom|react-router|react-router-dom|scheduler)\//,
|
||||
test: /node_modules\/(react|react-dom|scheduler)\//,
|
||||
},
|
||||
{
|
||||
priority: 110,
|
||||
name: 'mui-icons',
|
||||
test: /node_modules\/@mui\/icons-material\//,
|
||||
},
|
||||
{
|
||||
priority: 105,
|
||||
name: 'emotion-vendor',
|
||||
test: /node_modules\/@emotion\//,
|
||||
},
|
||||
{
|
||||
priority: 100,
|
||||
name: 'mui-vendor',
|
||||
test: /node_modules\/(@mui|@emotion)\//,
|
||||
test: /node_modules\/@mui\//,
|
||||
},
|
||||
{
|
||||
priority: 100,
|
||||
name: 'jsquash-image',
|
||||
test: /node_modules\/@jsquash\/(avif|resize)\//,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user