fix: module library export definitions when multiple runtimes#20179
Merged
alexander-akait merged 1 commit intomainfrom Nov 28, 2025
Merged
fix: module library export definitions when multiple runtimes#20179alexander-akait merged 1 commit intomainfrom
alexander-akait merged 1 commit intomainfrom
Conversation
Contributor
|
This PR is packaged and the instant preview is available (9dc25ca). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@9dc25ca
yarn add -D webpack@https://pkg.pr.new/webpack@9dc25ca
pnpm add -D webpack@https://pkg.pr.new/webpack@9dc25ca |
227c6ba to
9280368
Compare
9280368 to
7fd501d
Compare
CodSpeed Performance ReportMerging #20179 will improve performances by 22.48%Comparing Summary
Benchmarks breakdown
|
| PLUGIN_NAME, | ||
| (module, runtimes, source, finalName) => { | ||
| /** @type {BuildMeta} */ | ||
| const buildMeta = module.buildMeta || (module.buildMeta = {}); |
Member
There was a problem hiding this comment.
Sometimes I think we should improve buildMeta and buildInfo types, I think we have it here always, anyway let's do it separately
alexander-akait
approved these changes
Nov 28, 2025
Contributor
|
After updating webpack@https://pkg.pr.new/webpack@9dc25ca, I tested it in the actual project and it works normally. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What kind of change does this PR introduce?
Fixes #20164.
We should consider different runtimes during code generation. When the module hash varies between runtimes, the code generation will run multiple times. To prevent exports from being overwritten, we should store export sources and finalNames in
Mapinstead of usingstring.The PR also
ModuleLibraryPluginto make it clearer and library-specific.test/configCases/library/module-useless-export-requirement/entry3.js.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?
No