From efbc2ffe6a1ee5ec38a4396305561d6515d0943e Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 30 Aug 2024 17:21:18 +0800 Subject: node fixes, updates --- .../plugin-syntax-import-assertions/lib/index.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'node_modules/@babel/plugin-syntax-import-assertions/lib/index.js') 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"); } }; }); -- cgit v1.2.3