We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents baf0aa1 + 2a04dee commit 3e147e6Copy full SHA for 3e147e6
lib/dependencies/HarmonyDetectionParserPlugin.js
@@ -13,9 +13,13 @@ 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.type === "ImportDeclaration" ||
19
+ statement.type === "ExportDefaultDeclaration" ||
20
+ statement.type === "ExportNamedDeclaration" ||
21
+ statement.type === "ExportAllDeclaration"
22
+ );
23
if (isHarmony) {
24
const module = parser.state.module;
25
const compatDep = new HarmonyCompatibilityDependency(module);
0 commit comments