Skip to content
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

feat: custom shared module #480

Merged
merged 2 commits into from
Mar 8, 2024
Merged

feat: custom shared module #480

merged 2 commits into from
Mar 8, 2024

Conversation

huozhi
Copy link
Owner

@huozhi huozhi commented Mar 8, 2024

Introduce a new pattern that you can make your code being split into a certain chunk group, the modules like shared react context can be shared among among the bundles with same format.

Convention

<base name>.<layer>-runtime.<ext>

Having a file convention like foo.shared-runtime.js, it will match the convention and shared will become the layer it's going to be bundled into. Bundler will create a new chunk group contains those files.

If you have a shared module that needs to share across the entries, this convention can be used to achieve.

Resolves #429

@huozhi huozhi marked this pull request as ready for review March 8, 2024 23:42
@huozhi huozhi merged commit 7a966d2 into main Mar 8, 2024
3 checks passed
@huozhi huozhi deleted the feat/shared-runtime branch March 8, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Shared code auto code split
1 participant