Skip to content

Commit 232403c

Browse files
committed
fix discussions
1 parent 17e8eed commit 232403c

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

lib/config/defaults.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ const applyJavascriptParserOptionsDefaults = (
469469
D(parserOptions, "wrappedContextRecursive", true);
470470
D(parserOptions, "wrappedContextCritical", false);
471471
D(parserOptions, "strictThisContextOnImports", false);
472+
D(parserOptions, "importMeta", true);
472473
if (futureDefaults) D(parserOptions, "exportsPresence", "error");
473474
};
474475

@@ -501,9 +502,7 @@ const applyModuleDefaults = (
501502
D(module.parser.asset.dataUrlCondition, "maxSize", 8096);
502503
}
503504

504-
F(module.parser, "javascript", () => ({
505-
importMeta: true
506-
}));
505+
F(module.parser, "javascript", () => ({}));
507506
applyJavascriptParserOptionsDefaults(module.parser.javascript, {
508507
futureDefaults
509508
});

lib/dependencies/ImportMetaPlugin.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,6 @@ class ImportMetaPlugin {
6565
parser.state.module.addPresentationalDependency(dep);
6666
return true;
6767
});
68-
parser.hooks.unhandledExpressionMemberChain
69-
.for("import.meta")
70-
.tap("ImportMetaPlugin", (expr, members) => {
71-
const dep = new ConstDependency(
72-
`${importMetaName}${propertyAccess(members, 0)}`,
73-
expr.range
74-
);
75-
dep.loc = expr.loc;
76-
parser.state.module.addPresentationalDependency(dep);
77-
return true;
78-
});
7968
return;
8069
}
8170

test/Defaults.unittest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ describe("Defaults", () => {
218218
"exprContextRecursive": true,
219219
"exprContextRegExp": false,
220220
"exprContextRequest": ".",
221+
"importMeta": true,
221222
"strictExportPresence": undefined,
222223
"strictThisContextOnImports": false,
223224
"unknownContextCritical": true,

0 commit comments

Comments
 (0)