Open ccanos opened 3 months ago
From Svetlo in #4367:
Some code pushed in client-4637
// vite.config.ts
import { chunkSplitPlugin } from 'vite-plugin-chunk-split';
//...
plugins: [
chunkSplitPlugin({
strategy: 'unbundle',
customChunk: args => {
// files into pages directory is export in single files
let { file, id, moduleId, root } = args;
},
customSplitting: {
'react-vendor': ['react', 'react-dom'],
'core': [/src\/core/],
'dev': [/src\/dev/],
'domain': [/src\/domain/],
'main': [/src\/main/],
// 'core-ui': [/src\/core\/ui/],
// 'core-apollo': [/src\/core\/apollo/],
// 'core-auth': [/src\/core\/auth/],
// 'core-routing': [/src\/core\/routing/],
// 'core-utils': [/src\/core\/utils/],
}
})
]
index.html
adds some <link rel="modulepreload" crossorigin href="xxx">
and preloads all the resources when the page loads.
Description
As a an Alkemio user I want a reduced bundle so pages load faster
Acceptance criteria
Hints:
Additional Context
After extracting Excalidraw from the bundle, (#6593) maybe other things can also be extracted.
From another issue:
Areas that will be affected
Client. The whole application.
Timeboxed to: one day