Skip to content

Conversation

@LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Nov 4, 2025

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 correct webpack:// path for these modules.

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 4, 2025 11:21
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 4, 2025
@netlify
Copy link

netlify bot commented Nov 4, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit f81d046
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/690adce8fe73640008c03bb3

Copy link
Contributor

Copilot AI left a 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 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_relative and make_paths_absolute to use a new split_keep utility that preserves delimiters during path splitting
  • Updated context module's readable_identifier to 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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

📦 Binary Size-limit

Comparing f81d046 to chore(deps): update patch npm dependencies (#12084) by renovate[bot]

🎉 Size decreased by 768bytes from 47.85MB to 47.85MB (⬇️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 4, 2025

CodSpeed Performance Report

Merging #12078 will not alter performance

Comparing fix/source-map-relative-path (f81d046) with main (0591839)1

Summary

✅ 17 untouched

Footnotes

  1. No successful run was found on main (702dc01) during the generation of this report, so 0591839 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@LingyuCoder LingyuCoder requested a review from SyMind November 5, 2025 07:28
@LingyuCoder LingyuCoder enabled auto-merge (squash) November 5, 2025 07:32
@LingyuCoder LingyuCoder merged commit 9491c3a into main Nov 5, 2025
92 of 98 checks passed
@LingyuCoder LingyuCoder deleted the fix/source-map-relative-path branch November 5, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants