Skip to content

fix: use proper API to preserve source maps of inlined chunks#6734

Merged
chenjiahan merged 1 commit intomainfrom
inline_source_map_1209
Dec 9, 2025
Merged

fix: use proper API to preserve source maps of inlined chunks#6734
chenjiahan merged 1 commit intomainfrom
inline_source_map_1209

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Use updateAsset to preserve source maps of inlined chunks.

Calling compilation.deleteAsset(name) is not recommended and may lead to unexpected behavior.

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 03:49
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 9, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 0b195c8
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/69379c39ec42f90008a305a9
😎 Deploy Preview https://deploy-preview-6734--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: 77 (🟢 up 12 from production)
Accessibility: 100 (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
Copy Markdown
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 source map preservation when inlining chunks by using the proper Webpack/Rspack API (updateAsset) instead of directly manipulating the compilation.assets object or calling compilation.deleteAsset without preparation.

Key Changes

  • Introduced hasSourceMap variable to determine when source maps should be preserved
  • Replaced direct delete compilation.assets[name] with compilation.updateAsset() API to set related.sourceMap to null before deletion
  • Now consistently uses compilation.deleteAsset() for all asset removal operations

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

@chenjiahan chenjiahan merged commit 9ef0252 into main Dec 9, 2025
18 checks passed
@chenjiahan chenjiahan deleted the inline_source_map_1209 branch December 9, 2025 04:01
@chenjiahan chenjiahan mentioned this pull request Dec 9, 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