-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
fix(re-exports): reexports runtime calculation should not accessing __WEBPACK_IMPORT_KEY__ decl with var
#20249
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(re-exports): reexports runtime calculation should not accessing __WEBPACK_IMPORT_KEY__ decl with var
#20249
Conversation
🦋 Changeset detectedLatest commit: 2c4e037 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
I can't find the exact browserslist that supports |
|
@JSerFeng Let's fix style, just update prettier |
CodSpeed Performance ReportMerging #20249 will not alter performanceComparing Summary
Footnotes
|
… when using const as decl
6af3489 to
f3efe56
Compare
__WEBPACK_IMPORT_KEY__ decl with var
|
This PR is packaged and the instant preview is available (2efd21b). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@2efd21b
yarn add -D webpack@https://pkg.pr.new/webpack@2efd21b
pnpm add -D webpack@https://pkg.pr.new/webpack@2efd21b |
Andreo2301
left a comment
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.
@
Summary
When reexports dynamic, runtime code will like this:
However this getter only access variable
__WEBPACK_IMPORT_KEY__when it really gets invoked, but the__WEBPACK_IMPORT_KEY__is declared usingvar, which is in global scope not block scope inforstmt.That will cause every getter access the last
__WEBPACK_IMPORT_KEY__in the end.What kind of change does this PR introduce?
Fix
Did you add tests for your changes?
Yep.
Does this PR introduce a breaking change?
Nope.
If relevant, what needs to be documented once your changes are merged or what have you already documented?