fix: should generate correct relative path for context modules in sourcemap#12078
Merged
LingyuCoder merged 3 commits intomainfrom Nov 5, 2025
Merged
fix: should generate correct relative path for context modules in sourcemap#12078LingyuCoder merged 3 commits intomainfrom
LingyuCoder merged 3 commits intomainfrom
Conversation
✅ Deploy Preview for rspack canceled.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors context module identifier generation to use relative paths instead of absolute paths in readable identifiers. The key changes improve path handling to make module identifiers more portable and human-readable.
- Refactored
make_paths_relativeandmake_paths_absoluteto use a newsplit_keeputility that preserves delimiters during path splitting - Updated context module's
readable_identifierto return relative paths based on the context - Enabled several previously disabled test cases for source maps and multi-compiler configurations
Reviewed Changes
Copilot reviewed 41 out of 43 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_util/src/identifier.rs | Implemented split_keep helper and refactored path transformation functions to preserve delimiters |
| crates/rspack_util/Cargo.toml | Added "pattern" feature to regex dependency |
| crates/rspack_core/src/context_module.rs | Updated create_identifier and readable_identifier to support relative paths |
| tests/rspack-test/statsOutputCases/*.txt | Updated test snapshots to reflect relative path identifiers |
| tests/rspack-test/configCases/source-map//index. | Updated tests to use relative paths and enabled previously disabled tests |
| tests/rspack-test/configCases/split-chunks/*/test.config.js | Updated expected chunk filenames |
| tests/rspack-test/configCases/css/*/index.js | Updated expected CSS chunk IDs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/rspack-test/configCases/source-map/eval-nosources-source-map/index.ts
Show resolved
Hide resolved
Contributor
📦 Binary Size-limit
🎉 Size decreased by 768bytes from 47.85MB to 47.85MB (⬇️0.00%) |
CodSpeed Performance ReportMerging #12078 will not alter performanceComparing Summary
Footnotes |
SyMind
approved these changes
Nov 5, 2025
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
The
makePathsRelative()in rspack has a bug which lost delimiter like|and!. And if a module identifier contains these delimiters, the generated relative path can not resume to the original module identifier. Then the source map plugin can not generate correctwebpack://path for these modules.Related links
Checklist