feat: hoisting for "module-import" externals should be present in dynamic chunk#20559
feat: hoisting for "module-import" externals should be present in dynamic chunk#20559stefanbinoj wants to merge 2 commits intowebpack:mainfrom
Conversation
|
|
Hi @alexander-akait just wanted to check if this is the right solution or not? As it passes the tests (that i have written) also fixes the issue in minimal reporducable repo as said in the description. Or should the fix be around |
| if ( | ||
| this._resolveExternalType(this.externalType) === "module" && | ||
| this.buildInfo && | ||
| this.buildInfo.javascriptModule |
There was a problem hiding this comment.
checks output is esm
|
That is wrong fix |
|
We should look at chunkInitFragments |
fixes #20362
What kind of change does this PR introduce?
Previously while having
externalsType: 'module-import'and oneexternal: external-libthis external-lib was hoisted in the entry point of bundled output. This PR aims to hoist this external-lib to the dynamic chunk where importing of this package was doneDid 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?
I think so, since it is a feat request
Also take a look at this repo the
org_dist/shows previously generated bundles with hoisting in main entry point whiledist/shows new bundle that have been ran with this new branch it has hoisted only in dynamic chunk!