diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-08-30 17:21:18 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-08-30 17:21:18 +0800 |
| commit | efbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch) | |
| tree | 2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/@babel/plugin-syntax-import-assertions/lib/index.js | |
| parent | 43acceb75957c880a5ba5a31aae221394a36d5f6 (diff) | |
node fixes, updates
Diffstat (limited to 'node_modules/@babel/plugin-syntax-import-assertions/lib/index.js')
| -rw-r--r-- | node_modules/@babel/plugin-syntax-import-assertions/lib/index.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js b/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js index fe508b4e..33fe93cf 100644 --- a/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js +++ b/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js @@ -9,8 +9,24 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(api => { api.assertVersion(7); return { name: "syntax-import-assertions", - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("importAssertions"); + manipulateOptions(opts, { + plugins + }) { + for (let i = 0; i < plugins.length; i++) { + const plugin = plugins[i]; + if (plugin === "importAttributes") { + plugins[i] = ["importAttributes", { + deprecatedAssertSyntax: true + }]; + return; + } + if (Array.isArray(plugin) && plugin[0] === "importAttributes") { + if (plugin.length < 2) plugins[i].push({}); + plugin[1].deprecatedAssertSyntax = true; + return; + } + } + plugins.push("importAssertions"); } }; }); |
