feat: keep unknown import.meta properties#20312
Conversation
🦋 Changeset detectedLatest commit: 36b44e7 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 |
|
This PR is packaged and the instant preview is available (c3ce90b). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@c3ce90b
yarn add -D webpack@https://pkg.pr.new/webpack@c3ce90b
pnpm add -D webpack@https://pkg.pr.new/webpack@c3ce90b |
553df8a to
3daceaf
Compare
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
lib/dependencies/ImportMetaPlugin.js
Outdated
| PLUGIN_NAME, | ||
| // unknown import.meta properties should be determined at runtime | ||
| () => true | ||
| ); |
There was a problem hiding this comment.
Looks good, but let's do it under the option, we have D(parserOptions, "importMeta", true); right now, but we need importMeta: boolean | "preserve-unknown", let's set preserve-unknown when output.module is true, we still should replace it when output.module is false, otherwise code will not work
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "webpack": patch | |||
There was a problem hiding this comment.
Let's do it under minor
7f63a24 to
51812e1
Compare
Summary
Unknown import.meta properties are now determined at runtime instead of being statically analyzed at compile time.
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?
Nothing