8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccc7db7 commit 41b6887Copy full SHA for 41b6887
lib/dependencies/HarmonyDetectionParserPlugin.js
@@ -13,9 +13,11 @@ module.exports = class HarmonyDetectionParserPlugin {
13
const isStrictHarmony = parser.state.module.type === "javascript/esm";
14
const isHarmony =
15
isStrictHarmony ||
16
- ast.body.some(statement => {
17
- return /^(Import|Export).*Declaration$/.test(statement.type);
18
- });
+ ast.body.some(statement => statement =>
+ statement.type === "ImportDeclaration" ||
+ statement.type === "ExportDefaultDeclaration" ||
19
+ statement.type === "ExportNamedDeclaration"
20
+ );
21
if (isHarmony) {
22
const module = parser.state.module;
23
const compatDep = new HarmonyCompatibilityDependency(module);
0 commit comments