Skip to content

Commit

Permalink
fix discussions
Browse files Browse the repository at this point in the history
  • Loading branch information
vankop committed Jan 28, 2022
1 parent 17e8eed commit 232403c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
5 changes: 2 additions & 3 deletions lib/config/defaults.js
Expand Up @@ -469,6 +469,7 @@ const applyJavascriptParserOptionsDefaults = (
D(parserOptions, "wrappedContextRecursive", true);
D(parserOptions, "wrappedContextCritical", false);
D(parserOptions, "strictThisContextOnImports", false);
D(parserOptions, "importMeta", true);
if (futureDefaults) D(parserOptions, "exportsPresence", "error");
};

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

F(module.parser, "javascript", () => ({
importMeta: true
}));
F(module.parser, "javascript", () => ({}));
applyJavascriptParserOptionsDefaults(module.parser.javascript, {
futureDefaults
});
Expand Down
11 changes: 0 additions & 11 deletions lib/dependencies/ImportMetaPlugin.js
Expand Up @@ -65,17 +65,6 @@ class ImportMetaPlugin {
parser.state.module.addPresentationalDependency(dep);
return true;
});
parser.hooks.unhandledExpressionMemberChain
.for("import.meta")
.tap("ImportMetaPlugin", (expr, members) => {
const dep = new ConstDependency(
`${importMetaName}${propertyAccess(members, 0)}`,
expr.range
);
dep.loc = expr.loc;
parser.state.module.addPresentationalDependency(dep);
return true;
});
return;
}

Expand Down
1 change: 1 addition & 0 deletions test/Defaults.unittest.js
Expand Up @@ -218,6 +218,7 @@ describe("Defaults", () => {
"exprContextRecursive": true,
"exprContextRegExp": false,
"exprContextRequest": ".",
"importMeta": true,
"strictExportPresence": undefined,
"strictThisContextOnImports": false,
"unknownContextCritical": true,
Expand Down

0 comments on commit 232403c

Please sign in to comment.