index.js.map 23.6 KB
{"version":3,"names":["pluginCoreJS2","_pluginCoreJS2","default","pluginCoreJS3","_pluginCoreJS3","pluginRegenerator","_pluginRegenerator","isPluginRequired","targets","support","isRequired","compatData","filterStageFromList","list","stageList","Object","keys","reduce","result","item","has","pluginLists","withProposals","withoutBugfixes","pluginsList","withBugfixes","assign","pluginsBugfixesList","withoutProposals","proposalPlugins","getPluginList","proposals","bugfixes","getPlugin","pluginName","plugin","availablePlugins","Error","transformIncludesAndExcludes","opts","opt","target","match","add","all","plugins","Set","builtIns","getModulesPluginNames","modules","transformations","shouldTransformESM","shouldTransformDynamicImport","shouldTransformExportNamespaceFrom","shouldParseTopLevelAwait","modulesPluginNames","push","console","warn","getPolyfillPlugins","useBuiltIns","corejs","polyfillTargets","include","exclude","shippedProposals","regenerator","debug","polyfillPlugins","pluginOptions","method","version","toString","undefined","major","legacyBabelPolyfillPlugin","usage","deprecated","removeRegeneratorEntryPlugin","getLocalTargets","optionsTargets","ignoreBrowserslistConfig","configPath","browserslistEnv","esmodules","browsers","getTargets","supportsStaticESM","caller","supportsDynamicImport","supportsExportNamespaceFrom","supportsTopLevelAwait","declarePreset","api","assertVersion","babelTargets","optionsExclude","forceAllTransforms","optionsInclude","loose","spec","normalizeOptions","semver","lt","hasUglifyTarget","uglify","transformTargets","shouldSkipExportNamespaceFrom","includes","excludes","moduleTransformations","pluginNames","filterItems","getOptionSpecificExcludesFor","pluginSyntaxMap","removeUnnecessaryItems","overlappingPlugins","removeUnsupportedItems","addProposalSyntaxPlugins","proposalSyntaxPlugins","pluginUseBuiltIns","Array","from","map","concat","log","JSON","stringify","prettifyTargets","forEach","logPlugin"],"sources":["../src/index.ts"],"sourcesContent":["import semver, { type SemVer } from \"semver\";\nimport { logPlugin } from \"./debug\";\nimport getOptionSpecificExcludesFor from \"./get-option-specific-excludes\";\nimport {\n  addProposalSyntaxPlugins,\n  removeUnnecessaryItems,\n  removeUnsupportedItems,\n} from \"./filter-items\";\nimport moduleTransformations from \"./module-transformations\";\nimport normalizeOptions from \"./normalize-options\";\nimport {\n  pluginSyntaxMap,\n  proposalPlugins,\n  proposalSyntaxPlugins,\n} from \"./shipped-proposals\";\nimport {\n  plugins as pluginsList,\n  pluginsBugfixes as pluginsBugfixesList,\n  overlappingPlugins,\n} from \"./plugins-compat-data\";\n\nimport removeRegeneratorEntryPlugin from \"./polyfills/regenerator\";\nimport legacyBabelPolyfillPlugin from \"./polyfills/babel-polyfill\";\n\nimport type { CallerMetadata } from \"@babel/core\";\n\nimport _pluginCoreJS2 from \"babel-plugin-polyfill-corejs2\";\nimport _pluginCoreJS3 from \"babel-plugin-polyfill-corejs3\";\nimport _pluginRegenerator from \"babel-plugin-polyfill-regenerator\";\nconst pluginCoreJS2 = _pluginCoreJS2.default || _pluginCoreJS2;\nconst pluginCoreJS3 = _pluginCoreJS3.default || _pluginCoreJS3;\nconst pluginRegenerator = _pluginRegenerator.default || _pluginRegenerator;\n\nimport getTargets, {\n  prettifyTargets,\n  filterItems,\n  isRequired,\n} from \"@babel/helper-compilation-targets\";\nimport type { Targets, InputTargets } from \"@babel/helper-compilation-targets\";\nimport availablePlugins from \"./available-plugins\";\nimport { declarePreset } from \"@babel/helper-plugin-utils\";\n\ntype ModuleTransformationsType =\n  typeof import(\"./module-transformations\").default;\nimport type { BuiltInsOption, ModuleOption, Options } from \"./types\";\n\n// TODO: Remove in Babel 8\nexport function isPluginRequired(targets: Targets, support: Targets) {\n  return isRequired(\"fake-name\", targets, {\n    compatData: { \"fake-name\": support },\n  });\n}\n\nfunction filterStageFromList(\n  list: { [feature: string]: Targets },\n  stageList: Set<string>,\n) {\n  return Object.keys(list).reduce((result, item) => {\n    if (!stageList.has(item)) {\n      // @ts-expect-error todo: refine result types\n      result[item] = list[item];\n    }\n\n    return result;\n  }, {});\n}\n\nconst pluginLists = {\n  withProposals: {\n    withoutBugfixes: pluginsList,\n    withBugfixes: Object.assign({}, pluginsList, pluginsBugfixesList),\n  },\n  withoutProposals: {\n    withoutBugfixes: filterStageFromList(pluginsList, proposalPlugins),\n    withBugfixes: filterStageFromList(\n      Object.assign({}, pluginsList, pluginsBugfixesList),\n      proposalPlugins,\n    ),\n  },\n};\n\nfunction getPluginList(proposals: boolean, bugfixes: boolean) {\n  if (proposals) {\n    if (bugfixes) return pluginLists.withProposals.withBugfixes;\n    else return pluginLists.withProposals.withoutBugfixes;\n  } else {\n    if (bugfixes) return pluginLists.withoutProposals.withBugfixes;\n    else return pluginLists.withoutProposals.withoutBugfixes;\n  }\n}\n\nconst getPlugin = (pluginName: string) => {\n  const plugin =\n    // @ts-expect-error plugin name is constructed from available plugin list\n    availablePlugins[pluginName]();\n\n  if (!plugin) {\n    throw new Error(\n      `Could not find plugin \"${pluginName}\". Ensure there is an entry in ./available-plugins.js for it.`,\n    );\n  }\n\n  return plugin;\n};\n\nexport const transformIncludesAndExcludes = (opts: Array<string>): any => {\n  return opts.reduce(\n    (result, opt) => {\n      const target = opt.match(/^(es|es6|es7|esnext|web)\\./)\n        ? \"builtIns\"\n        : \"plugins\";\n      result[target].add(opt);\n      return result;\n    },\n    {\n      all: opts,\n      plugins: new Set(),\n      builtIns: new Set(),\n    },\n  );\n};\n\nexport const getModulesPluginNames = ({\n  modules,\n  transformations,\n  shouldTransformESM,\n  shouldTransformDynamicImport,\n  shouldTransformExportNamespaceFrom,\n  shouldParseTopLevelAwait,\n}: {\n  modules: ModuleOption;\n  transformations: ModuleTransformationsType;\n  shouldTransformESM: boolean;\n  shouldTransformDynamicImport: boolean;\n  shouldTransformExportNamespaceFrom: boolean;\n  shouldParseTopLevelAwait: boolean;\n}) => {\n  const modulesPluginNames = [];\n  if (modules !== false && transformations[modules]) {\n    if (shouldTransformESM) {\n      modulesPluginNames.push(transformations[modules]);\n    }\n\n    if (\n      shouldTransformDynamicImport &&\n      shouldTransformESM &&\n      modules !== \"umd\"\n    ) {\n      modulesPluginNames.push(\"transform-dynamic-import\");\n    } else {\n      if (shouldTransformDynamicImport) {\n        console.warn(\n          \"Dynamic import can only be supported when transforming ES modules\" +\n            \" to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.\",\n        );\n      }\n      modulesPluginNames.push(\"syntax-dynamic-import\");\n    }\n  } else {\n    modulesPluginNames.push(\"syntax-dynamic-import\");\n  }\n\n  if (shouldTransformExportNamespaceFrom) {\n    modulesPluginNames.push(\"transform-export-namespace-from\");\n  } else {\n    modulesPluginNames.push(\"syntax-export-namespace-from\");\n  }\n\n  if (shouldParseTopLevelAwait) {\n    modulesPluginNames.push(\"syntax-top-level-await\");\n  }\n\n  return modulesPluginNames;\n};\n\nexport const getPolyfillPlugins = ({\n  useBuiltIns,\n  corejs,\n  polyfillTargets,\n  include,\n  exclude,\n  proposals,\n  shippedProposals,\n  regenerator,\n  debug,\n}: {\n  useBuiltIns: BuiltInsOption;\n  corejs: SemVer | null | false;\n  polyfillTargets: Targets;\n  include: Set<string>;\n  exclude: Set<string>;\n  proposals: boolean;\n  shippedProposals: boolean;\n  regenerator: boolean;\n  debug: boolean;\n}) => {\n  const polyfillPlugins = [];\n  if (useBuiltIns === \"usage\" || useBuiltIns === \"entry\") {\n    const pluginOptions = {\n      method: `${useBuiltIns}-global`,\n      version: corejs ? corejs.toString() : undefined,\n      targets: polyfillTargets,\n      include,\n      exclude,\n      proposals,\n      shippedProposals,\n      debug,\n    };\n\n    if (corejs) {\n      if (useBuiltIns === \"usage\") {\n        if (corejs.major === 2) {\n          polyfillPlugins.push(\n            [pluginCoreJS2, pluginOptions],\n            [legacyBabelPolyfillPlugin, { usage: true }],\n          );\n        } else {\n          polyfillPlugins.push(\n            [pluginCoreJS3, pluginOptions],\n            [legacyBabelPolyfillPlugin, { usage: true, deprecated: true }],\n          );\n        }\n        if (regenerator) {\n          polyfillPlugins.push([\n            pluginRegenerator,\n            { method: \"usage-global\", debug },\n          ]);\n        }\n      } else {\n        if (corejs.major === 2) {\n          polyfillPlugins.push(\n            [legacyBabelPolyfillPlugin, { regenerator }],\n            [pluginCoreJS2, pluginOptions],\n          );\n        } else {\n          polyfillPlugins.push(\n            [pluginCoreJS3, pluginOptions],\n            [legacyBabelPolyfillPlugin, { deprecated: true }],\n          );\n          if (!regenerator) {\n            polyfillPlugins.push([removeRegeneratorEntryPlugin, pluginOptions]);\n          }\n        }\n      }\n    }\n  }\n  return polyfillPlugins;\n};\n\nfunction getLocalTargets(\n  optionsTargets: Options[\"targets\"],\n  ignoreBrowserslistConfig: boolean,\n  configPath: string,\n  browserslistEnv: string,\n) {\n  if (optionsTargets?.esmodules && optionsTargets.browsers) {\n    console.warn(`\n@babel/preset-env: esmodules and browsers targets have been specified together.\n\\`browsers\\` target, \\`${optionsTargets.browsers.toString()}\\` will be ignored.\n`);\n  }\n\n  return getTargets(optionsTargets as InputTargets, {\n    ignoreBrowserslistConfig,\n    configPath,\n    browserslistEnv,\n  });\n}\n\nfunction supportsStaticESM(caller: CallerMetadata | undefined) {\n  // @ts-expect-error supportsStaticESM is not defined in CallerMetadata\n  return !!caller?.supportsStaticESM;\n}\n\nfunction supportsDynamicImport(caller: CallerMetadata | undefined) {\n  // @ts-expect-error supportsDynamicImport is not defined in CallerMetadata\n  return !!caller?.supportsDynamicImport;\n}\n\nfunction supportsExportNamespaceFrom(caller: CallerMetadata | undefined) {\n  // @ts-expect-error supportsExportNamespaceFrom is not defined in CallerMetadata\n  return !!caller?.supportsExportNamespaceFrom;\n}\n\nfunction supportsTopLevelAwait(caller: CallerMetadata | undefined) {\n  // @ts-expect-error supportsTopLevelAwait is not defined in CallerMetadata\n  return !!caller?.supportsTopLevelAwait;\n}\n\nexport default declarePreset((api, opts: Options) => {\n  api.assertVersion(7);\n\n  const babelTargets = api.targets();\n\n  const {\n    bugfixes,\n    configPath,\n    debug,\n    exclude: optionsExclude,\n    forceAllTransforms,\n    ignoreBrowserslistConfig,\n    include: optionsInclude,\n    loose,\n    modules,\n    shippedProposals,\n    spec,\n    targets: optionsTargets,\n    useBuiltIns,\n    corejs: { version: corejs, proposals },\n    browserslistEnv,\n  } = normalizeOptions(opts);\n\n  let targets = babelTargets;\n\n  if (\n    // @babel/core < 7.13.0 doesn't load targets (api.targets() always\n    // returns {} thanks to @babel/helper-plugin-utils), so we always want\n    // to fallback to the old targets behavior in this case.\n    semver.lt(api.version, \"7.13.0\") ||\n    // If any browserslist-related option is specified, fallback to the old\n    // behavior of not using the targets specified in the top-level options.\n    opts.targets ||\n    opts.configPath ||\n    opts.browserslistEnv ||\n    opts.ignoreBrowserslistConfig\n  ) {\n    if (!process.env.BABEL_8_BREAKING) {\n      // eslint-disable-next-line no-var\n      var hasUglifyTarget = false;\n\n      if (optionsTargets?.uglify) {\n        hasUglifyTarget = true;\n        delete optionsTargets.uglify;\n\n        console.warn(`\nThe uglify target has been deprecated. Set the top level\noption \\`forceAllTransforms: true\\` instead.\n`);\n      }\n    }\n\n    targets = getLocalTargets(\n      optionsTargets,\n      ignoreBrowserslistConfig,\n      configPath,\n      browserslistEnv,\n    );\n  }\n\n  const transformTargets = (\n    process.env.BABEL_8_BREAKING\n      ? forceAllTransforms\n      : forceAllTransforms || hasUglifyTarget\n  )\n    ? ({} as Targets)\n    : targets;\n\n  const include = transformIncludesAndExcludes(optionsInclude);\n  const exclude = transformIncludesAndExcludes(optionsExclude);\n\n  const compatData = getPluginList(shippedProposals, bugfixes);\n  const shouldSkipExportNamespaceFrom =\n    (modules === \"auto\" && api.caller?.(supportsExportNamespaceFrom)) ||\n    (modules === false &&\n      !isRequired(\"transform-export-namespace-from\", transformTargets, {\n        compatData,\n        includes: include.plugins,\n        excludes: exclude.plugins,\n      }));\n  const modulesPluginNames = getModulesPluginNames({\n    modules,\n    transformations: moduleTransformations,\n    // TODO: Remove the 'api.caller' check eventually. Just here to prevent\n    // unnecessary breakage in the short term for users on older betas/RCs.\n    shouldTransformESM: modules !== \"auto\" || !api.caller?.(supportsStaticESM),\n    shouldTransformDynamicImport:\n      modules !== \"auto\" || !api.caller?.(supportsDynamicImport),\n    shouldTransformExportNamespaceFrom: !shouldSkipExportNamespaceFrom,\n    shouldParseTopLevelAwait:\n      !api.caller || (api.caller(supportsTopLevelAwait) as boolean),\n  });\n\n  const pluginNames = filterItems(\n    compatData,\n    include.plugins,\n    exclude.plugins,\n    transformTargets,\n    modulesPluginNames,\n    getOptionSpecificExcludesFor({ loose }),\n    pluginSyntaxMap,\n  );\n  removeUnnecessaryItems(pluginNames, overlappingPlugins);\n  removeUnsupportedItems(pluginNames, api.version);\n  if (shippedProposals) {\n    addProposalSyntaxPlugins(pluginNames, proposalSyntaxPlugins);\n  }\n\n  const polyfillPlugins = getPolyfillPlugins({\n    useBuiltIns,\n    corejs,\n    polyfillTargets: targets,\n    include: include.builtIns,\n    exclude: exclude.builtIns,\n    proposals,\n    shippedProposals,\n    regenerator: pluginNames.has(\"transform-regenerator\"),\n    debug,\n  });\n\n  const pluginUseBuiltIns = useBuiltIns !== false;\n  const plugins = Array.from(pluginNames)\n    .map(pluginName => {\n      if (\n        pluginName === \"transform-class-properties\" ||\n        pluginName === \"transform-private-methods\" ||\n        pluginName === \"transform-private-property-in-object\"\n      ) {\n        return [\n          getPlugin(pluginName),\n          {\n            loose: loose\n              ? \"#__internal__@babel/preset-env__prefer-true-but-false-is-ok-if-it-prevents-an-error\"\n              : \"#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error\",\n          },\n        ];\n      }\n      return [\n        getPlugin(pluginName),\n        { spec, loose, useBuiltIns: pluginUseBuiltIns },\n      ];\n    })\n    .concat(polyfillPlugins);\n\n  if (debug) {\n    console.log(\"@babel/preset-env: `DEBUG` option\");\n    console.log(\"\\nUsing targets:\");\n    console.log(JSON.stringify(prettifyTargets(targets), null, 2));\n    console.log(`\\nUsing modules transform: ${modules.toString()}`);\n    console.log(\"\\nUsing plugins:\");\n    pluginNames.forEach(pluginName => {\n      logPlugin(pluginName, targets, compatData);\n    });\n\n    if (!useBuiltIns) {\n      console.log(\n        \"\\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.\",\n      );\n    }\n  }\n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