Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Ensure VS Code and browser debuggers can correctly resolve breakpoints by using POSIX-style absolute paths in source maps during web development.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings November 3, 2025 11:19
@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit a7ab079
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/69088fb3f78f940008c0a1b1
😎 Deploy Preview https://deploy-preview-6492--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 68 (🟢 up 10 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

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 updates the source map configuration logic to use a function for devtoolModuleFilenameTemplate during development for web targets, ensuring POSIX-style absolute paths for better debugger compatibility. The test snapshots are updated to reflect that the configuration value is now a function rather than a string.

Key Changes

  • Modified devtoolModuleFilenameTemplate to use a function that converts paths to POSIX format during development for web targets
  • Added conditional logic based on isDev and target parameters
  • Updated comment to clarify the purpose of the processAssets check

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/plugins/sourceMap.ts Implements conditional function-based devtoolModuleFilenameTemplate for dev/web builds with POSIX path conversion
packages/core/tests/snapshots/environments.test.ts.snap Updates snapshot to expect [Function] instead of string template
packages/core/tests/snapshots/default.test.ts.snap Updates snapshot to expect [Function] instead of string template (3 occurrences)
packages/core/tests/snapshots/builder.test.ts.snap Updates snapshot to expect [Function] instead of string template
packages/compat/webpack/tests/snapshots/default.test.ts.snap Updates snapshot to expect [Function] instead of string template
Comments suppressed due to low confidence (1)

packages/core/src/plugins/sourceMap.ts:88

  • The processAssets hook checks if devtoolModuleFilenameTemplate !== DEFAULT_SOURCE_MAP_TEMPLATE, but in development mode with web target, the value is now set to a function (lines 45-48), not the string constant. This comparison will always be true when a function is used, causing the hook to incorrectly skip processing source maps in development builds. The check should account for both string templates and function values, or be updated to handle the new function-based approach.
        if (
          compilation.outputOptions.devtoolModuleFilenameTemplate !==
          DEFAULT_SOURCE_MAP_TEMPLATE
        ) {
          return;
        }

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

@chenjiahan chenjiahan merged commit 1910872 into main Nov 3, 2025
18 checks passed
@chenjiahan chenjiahan deleted the vscode_debugging_1103 branch November 3, 2025 11:27
@chenjiahan chenjiahan mentioned this pull request Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants