diff --git a/babel.config.js b/babel.config.js index 97e0313da1..c68f3f5bc4 100644 --- a/babel.config.js +++ b/babel.config.js @@ -5,11 +5,12 @@ module.exports = function(api) { const includeCoverage = process.env.BABEL_COVERAGE === "true"; - const envOpts = { + const envOptsNoTargets = { loose: true, modules: false, exclude: ["transform-typeof-symbol"], }; + const envOpts = Object.assign({}, envOptsNoTargets); let convertESM = true; let ignoreLib = true; @@ -97,6 +98,11 @@ module.exports = function(api) { convertESM ? "@babel/transform-modules-commonjs" : null, ].filter(Boolean), }, + { + test: "./packages/babel-polyfill", + presets: [["@babel/env", envOptsNoTargets]], + plugins: [["@babel/transform-modules-commonjs", { lazy: false }]], + }, { // The vast majority of our src files are modules, but we use // unambiguous to keep things simple until we get around to renaming