Skip to content

Conversation

@SyMind
Copy link
Member

@SyMind SyMind commented Dec 18, 2025

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

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

@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit f5606c6
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/694367f52fc44e00087347d0

@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 Dec 18, 2025
@SyMind SyMind marked this pull request as ready for review December 18, 2025 02:24
Copilot AI review requested due to automatic review settings December 18, 2025 02:24
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 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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📊 Quick Summary (Click to expand)
Project Total Size Change
react-10k 5.7 MB ➡️ 0 B (0.0%)
react-1k 823.4 KB ➡️ 0 B (0.0%)
react-5k 2.7 MB ➡️ 0 B (0.0%)
rome 984.3 KB ➡️ 0 B (0.0%)
ui-components 2.1 MB ➡️ 0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: a0fc091c18 | PR: #12476

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB 0 B (0.0%)
📄 JavaScript 5.7 MB 5.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-10k Bundle Diff

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

📌 Baseline Commit: a0fc091c18 | PR: #12476

Metric Current Baseline Change
📊 Total Size 823.4 KB 823.4 KB 0 B (0.0%)
📄 JavaScript 823.4 KB 823.4 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-1k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: a0fc091c18 | PR: #12476

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB 0 B (0.0%)
📄 JavaScript 2.7 MB 2.7 MB 0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

📌 Baseline Commit: a0fc091c18 | PR: #12476

Metric Current Baseline Change
📊 Total Size 984.3 KB 984.3 KB 0 B (0.0%)
📄 JavaScript 984.3 KB 984.3 KB 0 B (0.0%)
🎨 CSS 0 B 0 B N/A
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: rome Bundle Diff

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: a0fc091c18 | PR: #12476

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB 0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB 0 B (0.0%)
🎨 CSS 83.0 KB 83.0 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 0 B 0 B N/A

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

📦 Binary Size-limit

Comparing f5606c6 to refactor(esm-lib-plugin): manually resolve exports that re star-exported, and improve NodeTargetPlugin for module output (#12476) by Fy

❌ Size increased by 384bytes from 48.26MB to 48.26MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 18, 2025

CodSpeed Performance Report

Merging #12493 will not alter performance

Comparing relative-resource-path-in-windows (f5606c6) with main (a0fc091)

Summary

✅ 17 untouched

@chenjiahan chenjiahan changed the title fix: relative resource path in windows fix: relative resource path in source maps on Windows Dec 18, 2025
@chenjiahan chenjiahan merged commit 3a9bd34 into main Dec 18, 2025
54 checks passed
@chenjiahan chenjiahan deleted the relative-resource-path-in-windows branch December 18, 2025 04:45
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