Thanks to visit codestin.com Credit goes to github.com
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 5996f97 commit e5d28bdCopy full SHA for e5d28bd
1 file changed
packages/babel-plugin-syntax-import-attributes/src/index.ts
@@ -29,10 +29,17 @@ export default declare((api, { deprecatedAssertSyntax }: Options) => {
29
deprecatedAssertSyntax = true;
30
}
31
32
- parserOpts.plugins.push([
33
- "importAttributes",
34
- { deprecatedAssertSyntax: Boolean(deprecatedAssertSyntax) },
35
- ]);
+ const [major] = api.version.split(".").map(Number);
+ if (major >= 8) {
+ if (deprecatedAssertSyntax) {
+ parserOpts.plugins.push("deprecatedImportAssert");
36
+ }
37
+ } else {
38
+ parserOpts.plugins.push([
39
+ "importAttributes",
40
+ { deprecatedAssertSyntax: Boolean(deprecatedAssertSyntax) },
41
+ ]);
42
43
},
44
};
45
});
0 commit comments