Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with external module resolution in Rspack, specifically addressing how ESM modules are resolved during the external resolution process. The fix corrects the dependency category and resolve context being passed to the resolver.
- Corrects resolver configuration to use the proper dependency category and context
- Adds comprehensive test coverage for external resolution with both ESM and CommonJS modules
- Ensures external modules resolve to the correct module type based on import syntax
Reviewed Changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
crates/rspack_binding_api/src/raw_options/raw_external.rs |
Fixes resolver configuration by using first_clone instead of second_clone for dependency category and resolve context |
packages/rspack-test-tools/tests/configCases/externals/get-resolve/rspack.config.js |
Adds test configuration for external resolution with custom logic to handle both .mjs and .cjs files |
packages/rspack-test-tools/tests/configCases/externals/get-resolve/index.js |
Adds test cases verifying correct resolution of external modules via require() and import() |
packages/rspack-test-tools/tests/configCases/externals/get-resolve/rspack.config.js
Outdated
Show resolved
Hide resolved
✅ Deploy Preview for rspack canceled.
|
c120c64 to
ba0df5a
Compare
Contributor
📦 Binary Size-limit
🙈 Size remains the same at 49.00MB |
fi3ework
approved these changes
Jul 23, 2025
CodSpeed Performance ReportMerging #11144 will not alter performanceComparing Summary
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an issue with external module resolution in Rspack, specifically addressing how ESM modules are resolved during the external resolution process. The fix corrects the dependency category and resolve context being passed to the resolver.
Related links
Checklist