Skip to content

Conversation

@SyMind
Copy link
Member

@SyMind SyMind commented Dec 9, 2025

Summary

This PR fixes the handling of output.filename placeholders in source map generation when using the [relative-resource-path] template. Previously, the source map path resolution didn't account for subdirectories in the output filename (e.g., static/js/[name].js), resulting in incorrect source map file paths.

Related links

Checklist

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

Copilot AI review requested due to automatic review settings December 9, 2025 11:20
@netlify
Copy link

netlify bot commented Dec 9, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit e5e6898
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6938e4a123bea20008992c92

@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 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

📝 Benchmark detail: Open

task failure

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 the handling of output.filename placeholders in source map generation when using the [relative-resource-path] template. Previously, the source map path resolution didn't account for subdirectories in the output filename (e.g., static/js/[name].js), resulting in incorrect source map file paths.

Key Changes:

  • Modified get_unresolved_source_map_path to resolve the source map filename template with the actual asset filename, ensuring source maps are placed in the correct directory structure
  • Changed the function from synchronous to asynchronous to support template rendering
  • Updated test configuration to verify the fix works with nested output paths

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs Updated get_unresolved_source_map_path to accept asset filename and render templates, converting from sync to async function
tests/rspack-test/configCases/source-map/relative-resource-path/rspack.config.js Added filename: 'static/js/[name].js' to test nested output paths and updated source map path expectation
tests/rspack-test/configCases/source-map/relative-resource-path/test.config.js Added findBundle configuration to locate the generated bundle in the nested directory structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📁 react-10k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 5.7 MB - -
📄 JavaScript 5.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-1k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 823.6 KB - -
📄 JavaScript 823.6 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-5k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.7 MB - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 ui-components

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.1 MB - -
📄 JavaScript 2.0 MB - -
🎨 CSS 83.0 KB - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 rome

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 984.3 KB - -
📄 JavaScript 984.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

📦 Binary Size-limit

Comparing e5e6898 to chore(ci): run Mac CI test on github hosted runner (#12397) by pshu

❌ Size increased by 1.38KB from 47.71MB to 47.72MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 9, 2025

CodSpeed Performance Report

Merging #12398 will not alter performance

Comparing fix-get_unresolved_source_map_path (e5e6898) with main (80c4537)

Summary

✅ 17 untouched

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

📝 Benchmark detail: Open

Name Base (2025-12-09 ceb43c5) Current Change
10000_big_production-mode_disable-minimize + exec 24.8 s ± 596 ms 24.9 s ± 507 ms +0.73 %
10000_development-mode + exec 1.27 s ± 25 ms 1.22 s ± 11 ms -3.90 %
10000_development-mode_hmr + exec 590 ms ± 5.3 ms 586 ms ± 12 ms -0.77 %
10000_development-mode_noop-loader + exec 2.19 s ± 33 ms 2.16 s ± 72 ms -1.44 %
10000_production-mode + exec 1.35 s ± 62 ms 1.3 s ± 31 ms -3.40 %
10000_production-mode_persistent-cold + exec 1.48 s ± 20 ms 1.47 s ± 160 ms -0.73 %
10000_production-mode_persistent-hot + exec 1.02 s ± 12 ms 1.01 s ± 26 ms -1.06 %
arco-pro_development-mode + exec 1.56 s ± 93 ms 1.43 s ± 78 ms -8.83 %
arco-pro_development-mode_hmr + exec 360 ms ± 0.98 ms 360 ms ± 1.8 ms -0.12 %
arco-pro_production-mode + exec 2.91 s ± 116 ms 2.77 s ± 93 ms -4.56 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 2.96 s ± 109 ms 2.81 s ± 54 ms -5.00 %
arco-pro_production-mode_persistent-cold + exec 3.02 s ± 97 ms 2.87 s ± 213 ms -4.96 %
arco-pro_production-mode_persistent-hot + exec 1.65 s ± 50 ms 1.62 s ± 27 ms -2.10 %
arco-pro_production-mode_traverse-chunk-modules + exec 2.99 s ± 107 ms 2.84 s ± 150 ms -4.91 %
large-dyn-imports_development-mode + exec 1.56 s ± 19 ms 1.5 s ± 39 ms -3.27 %
large-dyn-imports_production-mode + exec 1.61 s ± 44 ms 1.58 s ± 61 ms -2.36 %
threejs_development-mode_10x + exec 1.27 s ± 12 ms 1.31 s ± 54 ms +3.37 %
threejs_development-mode_10x_hmr + exec 898 ms ± 9.5 ms 939 ms ± 11 ms +4.63 %
threejs_production-mode_10x + exec 3.92 s ± 175 ms 3.97 s ± 192 ms +1.17 %
threejs_production-mode_10x_persistent-cold + exec 4.03 s ± 22 ms 4.13 s ± 218 ms +2.41 %
threejs_production-mode_10x_persistent-hot + exec 3.52 s ± 11 ms 3.52 s ± 19 ms +0.17 %
10000_big_production-mode_disable-minimize + rss memory 5356 MiB ± 158 MiB 5364 MiB ± 193 MiB +0.16 %
10000_development-mode + rss memory 563 MiB ± 31.9 MiB 563 MiB ± 22.5 MiB +0.02 %
10000_development-mode_hmr + rss memory 730 MiB ± 18.3 MiB 718 MiB ± 9.22 MiB -1.67 %
10000_development-mode_noop-loader + rss memory 856 MiB ± 33.5 MiB 872 MiB ± 28.9 MiB +1.89 %
10000_production-mode + rss memory 600 MiB ± 18.8 MiB 610 MiB ± 37.2 MiB +1.71 %
10000_production-mode_persistent-cold + rss memory 688 MiB ± 18.3 MiB 679 MiB ± 25.1 MiB -1.28 %
10000_production-mode_persistent-hot + rss memory 688 MiB ± 31.2 MiB 689 MiB ± 58.4 MiB +0.12 %
arco-pro_development-mode + rss memory 464 MiB ± 36 MiB 501 MiB ± 57.9 MiB +8.05 %
arco-pro_development-mode_hmr + rss memory 389 MiB ± 21.7 MiB 423 MiB ± 8 MiB +8.63 %
arco-pro_production-mode + rss memory 561 MiB ± 81.1 MiB 625 MiB ± 58.4 MiB +11.42 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 594 MiB ± 72.7 MiB 618 MiB ± 38.9 MiB +4.00 %
arco-pro_production-mode_persistent-cold + rss memory 655 MiB ± 40.9 MiB 671 MiB ± 33.8 MiB +2.49 %
arco-pro_production-mode_persistent-hot + rss memory 496 MiB ± 73.5 MiB 521 MiB ± 51.7 MiB +4.98 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 606 MiB ± 95 MiB 608 MiB ± 57.6 MiB +0.38 %
large-dyn-imports_development-mode + rss memory 589 MiB ± 8.8 MiB 584 MiB ± 8.24 MiB -0.80 %
large-dyn-imports_production-mode + rss memory 543 MiB ± 11.6 MiB 545 MiB ± 12.5 MiB +0.44 %
threejs_development-mode_10x + rss memory 524 MiB ± 15.5 MiB 535 MiB ± 33.9 MiB +2.09 %
threejs_development-mode_10x_hmr + rss memory 750 MiB ± 67.5 MiB 724 MiB ± 24.8 MiB -3.43 %
threejs_production-mode_10x + rss memory 692 MiB ± 127 MiB 683 MiB ± 98.8 MiB -1.24 %
threejs_production-mode_10x_persistent-cold + rss memory 739 MiB ± 63.5 MiB 742 MiB ± 53 MiB +0.40 %
threejs_production-mode_10x_persistent-hot + rss memory 599 MiB ± 42.7 MiB 609 MiB ± 61.3 MiB +1.76 %

chenjiahan
chenjiahan previously approved these changes Dec 9, 2025
@chenjiahan chenjiahan merged commit df793ab into main Dec 10, 2025
52 checks passed
@chenjiahan chenjiahan deleted the fix-get_unresolved_source_map_path branch December 10, 2025 03:32
@CPunisher CPunisher mentioned this pull request Dec 17, 2025
2 tasks
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