-
Notifications
You must be signed in to change notification settings - Fork 38
feat(build): Remove 'index' fallback to enable proper dynamic chunking #9837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(build): Remove 'index' fallback to enable proper dynamic chunking #9837
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the Vite build configuration to enable proper dynamic chunking by removing the default 'index' fallback in the manualChunks function. By returning undefined instead of 'index', Rollup can automatically handle chunk splitting, allowing dynamically imported resources (such as i18n JSON files) to be bundled into separate chunks rather than being combined into a single large index chunk.
Key Changes:
- Removed the
'index'fallback return value in themanualChunksconfiguration, replacing it with an implicitundefinedreturn
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Superseded by: |
|
Reopening this PR, since we require smarter chunks |
…roper-dynamic-chunking
| } | ||
|
|
||
| return 'index'; | ||
| return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? I would have expected an exception for the languages, hasn't this for side effect to chunks the entire OISY code base?
Pull request was converted to draft
Motivation
This change removes the
'index'fallback in the VitemanualChunksconfiguration. Returningundefinedlets Rollup handle chunk splitting automatically, allowing dynamic imports (likei18nJSON files) to be bundled separately instead of being merged into a single large index chunk.Before --> 2 chunks (biggest 5.4 MB)
After --> 168 chunks (biggest 2.1 MB)