You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
4.9 KiB
1 line
4.9 KiB
1 month ago
|
{"version":3,"names":["pluginCorejs2","require","default","pluginCorejs3","pluginRegenerator","pluginsCompat","createCorejs2Plugin","options","api","_","filename","createCorejs3Plugin","createRegeneratorPlugin","useRuntimeRegenerator","corejsPlugin","undefined","Object","assign","inherits","module","exports","createBasePolyfillsPlugin","corejs","regenerator","moduleName","runtimeVersion","absoluteImports","proposals","rawVersion","version","Boolean","corejsVersion","Number","includes","Error","JSON","stringify","polyfillOpts","method","useBabelRuntime","ext"],"sources":["../../src/babel-7/polyfills.cjs"],"sourcesContent":["// TODO(Babel 8) Remove this file\nif (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Internal Babel error: This file should only be loaded in Babel 7\",\n );\n}\n\nconst pluginCorejs2 = require(\"babel-plugin-polyfill-corejs2\").default;\nconst pluginCorejs3 = require(\"babel-plugin-polyfill-corejs3\").default;\nconst pluginRegenerator = require(\"babel-plugin-polyfill-regenerator\").default;\n\nconst pluginsCompat = \"#__secret_key__@babel/runtime__compatibility\";\n\nfunction createCorejs2Plugin(options) {\n return (api, _, filename) => pluginCorejs2(api, options, filename);\n}\n\nfunction createCorejs3Plugin(options) {\n return (api, _, filename) => pluginCorejs3(api, options, filename);\n}\n\nfunction createRegeneratorPlugin(options, useRuntimeRegenerator, corejsPlugin) {\n if (!useRuntimeRegenerator) return corejsPlugin ?? undefined;\n return (api, _, filename) => {\n return {\n ...pluginRegenerator(api, options, filename),\n inherits: corejsPlugin ?? undefined,\n };\n };\n}\n\nmodule.exports = function createBasePolyfillsPlugin(\n { corejs, regenerator = true, moduleName },\n runtimeVersion,\n absoluteImports,\n) {\n let proposals = false;\n let rawVersion;\n\n if (typeof corejs === \"object\" && corejs !== null) {\n rawVersion = corejs.version;\n proposals = Boolean(corejs.proposals);\n } else {\n rawVersion = corejs;\n }\n\n const corejsVersion = rawVersion ? Number(rawVersion) : false;\n\n if (![false, 2, 3].includes(corejsVersion)) {\n throw new Error(\n `The \\`core-js\\` version must be false, 2 or 3, but got ${JSON.stringify(\n rawVersion,\n )}.`,\n );\n }\n\n if (proposals && (!corejsVersion || corejsVersion < 3)) {\n throw new Error(\n \"The 'proposals' option is only supported when using 'corejs: 3'\",\n );\n }\n\n if (typeof regenerator !== \"boolean\") {\n throw new Error(\n \"The 'regenerator' option must be undefined, or a boolean.\",\n );\n }\n\n const polyfillOpts = {\n method: \"usage-pure\",\n absoluteImports,\n proposals,\n [pluginsCompat]: {\n useBabelRuntime: true,\n runtimeVersion,\n ext: \"\",\n moduleName,\n },\n };\n\n return createRegeneratorPlugin(\n polyfillOpts,\n regenerator,\n corejsVersion === 2\n ? createCorejs2Plugin(polyfillOpts)\n : corejsVersion === 3\n ? createCorejs3Plugin(polyfillOpts)\n : null,\n );\n};\n"],"mappings":";AAOA,MAAMA,aAAa,GAAGC,OAAO,CAAC,+BAA+B,CAAC,CAACC,OAAO;AACtE,MAAMC,aAAa,GAAGF,OAAO,CAAC,+BAA+B,CAAC,CAACC,OAAO;AACtE,MAAME,iBAAiB,GAAGH,OAAO,CAAC,mCAAmC,CAAC,CAACC,OAAO;AAE9E,MAAMG,aAAa,GAAG,8CAA8C;AAEpE,SAASC,mBAAmBA,CAACC,OAAO,EAAE;EACpC,OAAO,CAACC,GAAG,EAAEC,CAAC,EAAEC,QAAQ,KAAKV,aAAa,CAACQ,GAAG,EAAED,OAAO,EAAEG,QAAQ,CAAC;AACpE;AAEA,SAASC,mBAAmBA,CAACJ,OAAO,EAAE;EACpC,OAAO,CAACC,GAAG,EAAEC,CAAC,EAAEC,QAAQ,KAAKP,aAAa,CAACK,GAAG,EAAED,OAAO,EAAEG,QAAQ,CAAC;AACpE;AAEA,SAASE,uBAAuBA,CAACL,OAAO,EAAEM,qBAAqB,EAAEC,YAAY,EAAE;EAC7E,IAAI,CAACD,qBAAqB,EAAE,OAAOC,YAAY,WAAZA,YAAY,GAAIC,SAAS;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