-
-
Notifications
You must be signed in to change notification settings - Fork 724
fix: distinguish external modules when there are import attributes #11845
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?
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📦 Binary Size-limit
❌ Size increased by 1.63KB from 47.89MB to 47.89MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #11845 will not alter performanceComparing Summary
|
2477535
to
315c13b
Compare
315c13b
to
c694871
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
This PR fixes a bug where external modules with import attributes were not being distinguished from those without attributes, causing incorrect import statement merging. The fix ensures that import attributes are properly considered when generating unique keys for external module fragments.
- Added import attributes to external module identifier generation
- Updated InitFragmentKey generation to include import attributes
- Added test coverage to verify correct handling of imports with and without attributes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
crates/rspack_core/src/external_module.rs | Core fix implementing attribute-aware fragment key generation and module identification |
tests/rspack-test/configCases/externals/import-attributes/index.js | Added test cases for imports with and without attributes |
tests/rspack-test/configCases/externals/import-attributes/rspack.config.js | Added assertions to verify distinct handling of imports with different attributes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
previously, there's no difference when importing an external module with and without import attributes, as the ChunkInitFragment key didn't counting import attributes.
source
result before
result now
Related links
Checklist