New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: broken library output by webpackPrefetch #13431
Fix: broken library output by webpackPrefetch #13431
Conversation
For maintainers only:
|
buf2.push( | ||
`__webpack_exports__ = ${RuntimeGlobals.onChunksLoaded}(__webpack_exports__);` | ||
); | ||
if (runtimeRequirements.has(RuntimeGlobals.prefetchChunk)) { | ||
buf2.push(`${RuntimeGlobals.onChunksLoaded}();`); | ||
} else { | ||
buf2.push( | ||
`__webpack_exports__ = ${RuntimeGlobals.onChunksLoaded}(__webpack_exports__);` | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought onChunksLoaded
fired by webpackPrefetch should not overwrite __webpack_exports__
because prefetchChunkHandlers
return void, so I fixed issue 12993 by changing how to call onChunksLoaded
with prefetchChunk.
If my approach is not correct or a test case is not enough, please feel free to close this PR or request changes.
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
Any chance this (or an alternative fix) will make it to prod soon? Happy to help move along if I can. |
bc456ff
to
8ce0f24
Compare
8ce0f24
to
c469adc
Compare
Thanks |
Fix: #12993
dynamic import with
webpackPrefetch: true
will cause a broken library output in development mode.This PR will fix this issue
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
yes
Does this PR introduce a breaking change?
no
What needs to be documented once your changes are merged?
none