Skip to content

Conversation

@yifancong
Copy link
Contributor

@yifancong yifancong commented Oct 22, 2025

Summary

fix: resolve module content duplication when module appears in multiple chunks

When a module is bundled by multiple chunks, the module content in sourceMapSets will be concatenated multiple times with the module codes, resulting in inaccurate module size.

Related Links

@netlify
Copy link

netlify bot commented Oct 22, 2025

Deploy Preview for rsdoctor ready!

Name Link
🔨 Latest commit 0264215
🔍 Latest deploy log https://app.netlify.com/projects/rsdoctor/deploys/68f9da8ea604030008295120
😎 Deploy Preview https://deploy-preview-1367--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.

@yifancong yifancong changed the title Fix/sourcemap parse tool multi chunk fix: resolve module content duplication when module appears in multiple chunks Oct 23, 2025
@yifancong yifancong force-pushed the fix/sourcemap-parse-tool-multi-chunk branch from 7da099f to c6128ba Compare October 23, 2025 06:44
@yifancong yifancong marked this pull request as ready for review October 23, 2025 06:46
@Copilot Copilot AI review requested due to automatic review settings October 23, 2025 06:46
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 module content duplication when a module appears in multiple chunks by changing the sourcemap storage structure from concatenating all code segments to storing them separately per chunk.

Key Changes:

  • Modified sourceMapSets data structure to use nested Maps (module → chunk → content) instead of concatenating content
  • Added chunkName parameter to collectSourceMaps function to track which chunk each code segment belongs to
  • Added validation to warn when chunk name is not provided

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yifancong yifancong force-pushed the fix/sourcemap-parse-tool-multi-chunk branch 3 times, most recently from 7b46e95 to ec8d9d2 Compare October 23, 2025 07:06
@yifancong yifancong merged commit b705e6f into main Oct 23, 2025
8 checks passed
@yifancong yifancong deleted the fix/sourcemap-parse-tool-multi-chunk branch October 23, 2025 07:56
@yifancong yifancong mentioned this pull request Oct 24, 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