Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: cjs require destructuring assignment tree shaking#20548

Open
ahabhgk wants to merge 3 commits intowebpack:mainfrom
ahabhgk:cjs-tree-shaking-require-destructuring
Open

feat: cjs require destructuring assignment tree shaking#20548
ahabhgk wants to merge 3 commits intowebpack:mainfrom
ahabhgk:cjs-tree-shaking-require-destructuring

Conversation

@ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Feb 27, 2026

Summary

Support analyze const { a } = require("./m") for cjs tree shaking

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes

Does this PR introduce a breaking change?

No

If relevant, what needs to be documented once your changes are merged or what have you already documented?

None

@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

🦋 Changeset detected

Latest commit: 50b5663

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 27, 2026

Merging this PR will degrade performance by 37.67%

⚡ 1 improved benchmark
❌ 2 regressed benchmarks
✅ 123 untouched benchmarks
⏩ 18 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory benchmark "json-modules", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 619.7 KB 994.2 KB -37.67%
Memory benchmark "many-modules-commonjs", scenario '{"name":"mode-production","mode":"production"}' 8 MB 10.3 MB -22.84%
Memory benchmark "react", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 864.3 KB 645.1 KB +33.98%

Comparing ahabhgk:cjs-tree-shaking-require-destructuring (50b5663) with main (2019127)

Open in CodSpeed

Footnotes

  1. 18 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants