Skip to content

feat: sport the concatenated module size compute#1159

Merged
yifancong merged 7 commits intomainfrom
feat/concatenate-module
Jul 17, 2025
Merged

feat: sport the concatenated module size compute#1159
yifancong merged 7 commits intomainfrom
feat/concatenate-module

Conversation

@yifancong
Copy link
Copy Markdown
Contributor

@yifancong yifancong commented Jul 6, 2025

Summary

This PR addresses the challenge of splitting concatenated modules. Since concatenated modules aggregate multiple modules into a single closure, the previous bundle parsing approach could not accurately decompose them. This update leverages source maps to correctly split and identify individual modules within concatenated modules.

Source Map Handling

  • Introduced hooks in ensureModulesChunkGraph.ts to collect and process source maps during both compilation and emission stages.
  • Added sourcemapTool.ts to provide compatibility for splitting modules in both webpack and rspack environments.
  • Implemented utility functions such as ensureDevtools and emitHandler for validating and managing source map–related operations.

Tasks

  • The Rspack afterEmit hook generates sourcemapModuleSets
  • The Webpack emit hook generates sourcemapModuleSets
  • Compatible with legacy bundle parsing logic
  • UT

Dependency Updates

  • Added source-map-js as a new dependency in package.json to enhance source map support.

Related Links

#1170

@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 6, 2025

Deploy Preview for rsdoctor ready!

Name Link
🔨 Latest commit 82a4fe4
🔍 Latest deploy log https://app.netlify.com/projects/rsdoctor/deploys/687897747d7fe70009f92dc1
😎 Deploy Preview https://deploy-preview-1159--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 force-pushed the feat/concatenate-module branch from f3b3693 to 4827667 Compare July 15, 2025 12:23
@yifancong yifancong changed the title [WIP]feat: sport the concatenated module size compute feat: sport the concatenated module size compute Jul 15, 2025
@yifancong yifancong requested a review from LingyuCoder July 16, 2025 07:37
@yifancong yifancong force-pushed the feat/concatenate-module branch from 782218f to 82a4fe4 Compare July 17, 2025 06:25
@yifancong yifancong merged commit 273a541 into main Jul 17, 2025
7 checks passed
@yifancong yifancong deleted the feat/concatenate-module branch July 17, 2025 11:49
@yifancong yifancong mentioned this pull request Aug 7, 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