-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix: relative resource path in source maps on Windows #12493
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
✅ Deploy Preview for rspack canceled.
|
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 Windows-specific issues with relative resource paths in source maps by ensuring paths use forward slashes (URL-style) instead of backslashes (Windows filesystem style). Source maps require URL-style paths for cross-platform compatibility.
- Adds backslash-to-forward-slash conversion in the Rust source map generation logic
- Implements a test that validates source map paths are in normalized URL-style format
- Adds explicit path normalization when the source map has no parent directory
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/rspack_plugin_devtool/src/module_filename_helpers.rs |
Adds .replace("\\", "/") calls to convert Windows backslashes to forward slashes in relative resource paths for source maps |
tests/rspack-test/configCases/source-map/relative-resource-path/rspack.config.js |
Adds normalizeToUrlStyle helper function and test assertion to validate that source map paths use forward slashes and are normalized (no .. or . segments) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📊 Quick Summary (Click to expand)
📋 Detailed Reports (Click to expand)📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 384bytes from 48.26MB to 48.26MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12493 will not alter performanceComparing Summary
|
Summary
This PR fixes Windows-specific issues with relative resource paths in source maps by ensuring paths use forward slashes (URL-style) instead of backslashes (Windows filesystem style). Source maps require URL-style paths for cross-platform compatibility.
Related links
Checklist