Skip to content

fix: sourcemap tool problem#1436

Merged
yifancong merged 1 commit intomainfrom
fix/sourcemap-tool-problem
Dec 9, 2025
Merged

fix: sourcemap tool problem#1436
yifancong merged 1 commit intomainfrom
fix/sourcemap-tool-problem

Conversation

@yifancong
Copy link
Contributor

@yifancong yifancong commented Dec 9, 2025

Summary

If output.devtoolModuleFilenameTemplate = (info) => toPosixPath(info), i.e. the sources are relative paths without 'webpack://' or 'file://', that case wasn't handled properly before — this PR adds compatibility for it.

Related Links

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

netlify bot commented Dec 9, 2025

Deploy Preview for rsdoctor ready!

Name Link
🔨 Latest commit 4b1147b
🔍 Latest deploy log https://app.netlify.com/projects/rsdoctor/deploys/693804e465d33d0008c41449
😎 Deploy Preview https://deploy-preview-1436--rsdoctor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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 fixes sourcemap resolution issues by improving how relative and absolute source paths are resolved in sourcemaps. The changes add support for sourceRoot handling and proper resolution of sourcemap file locations.

Key changes:

  • Enhanced bindContextCache to handle relative paths using sourcemap directory and sourceRoot from sourcemap metadata
  • Added sourceMapPath tracking through collectSourceMaps, handleAfterEmitAssets, and handleEmitAssets functions
  • Removed rspack-specific skip condition in changeDevtoolModuleFilename to apply devtool configuration to both webpack and rspack

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/core/src/inner-plugins/plugins/sourcemapTool.ts Core fix: Added sourceMapDir and sourceRoot parameters for proper relative path resolution, made sourceMapFilenameRegex optional, enhanced path resolution logic
packages/core/src/inner-plugins/plugins/bundle.ts Removed rspack exclusion from devtool module filename configuration
packages/sdk/src/sdk/sdk/index.ts Added resolveFilePath helper function to handle root-relative and relative paths when inlining scripts and styles
packages/core/src/inner-plugins/plugins/ensureModulesChunkGraph.ts Added optimizationBailout flag to stats options
packages/types/src/plugin/baseStats.ts Added optimizationBailout optional property to StatsOptionsObj interface
examples/rsbuild-minimal/rsbuild.config.ts Removed commented-out mode configuration line

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

@yifancong yifancong force-pushed the fix/sourcemap-tool-problem branch 2 times, most recently from b9b622c to f0dcdd8 Compare December 9, 2025 09:46
@yifancong yifancong requested a review from fi3ework December 9, 2025 11:13
fix: sourcemap tool problem

fix: sourcemap tool problem

fix: sourcemap tool problem

fix: sourcemap tool problem

fix: sourcemap tool problem

fix: sourcemap tool problem
@yifancong yifancong force-pushed the fix/sourcemap-tool-problem branch from f0dcdd8 to 4b1147b Compare December 9, 2025 11:15
@yifancong yifancong requested a review from 9aoy December 9, 2025 11:20
@yifancong yifancong merged commit d5c2bc6 into main Dec 9, 2025
8 checks passed
@yifancong yifancong deleted the fix/sourcemap-tool-problem branch December 9, 2025 11:33
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.

3 participants