Update babel parse options for import assertions support (#16810)

This commit is contained in:
fisker Cheung authored and GitHub committed 2024-11-04 10:24:40 +08:00
1 parent 3e4b452b4a
commit c5648f7df7
1 file changed
+9 -1
+9 -1
View File
@@ -42,7 +42,6 @@ const parseOptions = {
"destructuringPrivate",
"decoratorAutoAccessors",
"explicitResourceManagement",
["importAttributes", { deprecatedAssertSyntax: true }],
"sourcePhaseImports",
"deferredImportEvaluation",
["optionalChainingAssign", { version: "2023-07" }],
@@ -199,6 +198,15 @@ const allowedReasonCodes = new Set([
"VarRedeclaration",
"InvalidPrivateFieldResolution",
"DuplicateExport",
/*
Legacy syntax
```js
import json from "./json.json" assert {type: "json"};
```
*/
"ImportAttributesUseAssert",
]);
const babelParserOptionsCombinations = [appendPlugins(["jsx"])];