-
-
Notifications
You must be signed in to change notification settings - Fork 57
fix: avoid chunk conflicts when multiple libs are present #1220
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
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
Fixes chunk filename conflicts in multi-compiler builds by adding index prefixes to chunk filenames. This prevents multiple compilers from generating chunks with identical filenames that could overwrite each other when hash is disabled.
- Added
composeOutputConfigfunction to prefix chunk filenames with compiler index in multi-compiler scenarios - Updated
composeLibRsbuildConfigandcomposeCreateRsbuildConfigto pass compiler index information - Added comprehensive test cases for both single and multi-compiler chunk naming scenarios
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/config.ts | Added output config composition and multi-compiler index tracking |
| tests/integration/output/index.test.ts | Added test cases for chunk filename behavior verification |
| tests/integration/output/chunkFileName-multi/ | Multi-compiler test fixture with shared dependencies |
| tests/integration/output/chunkFileName-single/ | Single-compiler test fixture for baseline comparison |
| packages/core/tests/snapshots/config.test.ts.snap | Updated snapshots reflecting new chunk filename patterns |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
✅ Deploy Preview for rslib ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
e3ea64b to
2535c8e
Compare
c9af289 to
6807abe
Compare
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
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
to fix the case added in test cases, multi-compiler don't know other compilers' existence, so it's prone to emit chunk file to same path, whereas the content might not the same. this it's not prone to happen in Rsbuild as the hash is enabled but hash is disabled in Rslib.
Related Links
Checklist