Transpile babel-polyfill to es5, instead of targeting node 6 (#9812)

* Transpile babel-polyfill to es5, instead of targeting node 6

* Update babel.config.js
This commit is contained in:
Nicolò Ribaudo 2019-04-15 20:01:16 +02:00 committed by GitHub
parent 165ef29416
commit e4072752bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,11 +5,12 @@ module.exports = function(api) {
const includeCoverage = process.env.BABEL_COVERAGE === "true"; const includeCoverage = process.env.BABEL_COVERAGE === "true";
const envOpts = { const envOptsNoTargets = {
loose: true, loose: true,
modules: false, modules: false,
exclude: ["transform-typeof-symbol"], exclude: ["transform-typeof-symbol"],
}; };
const envOpts = Object.assign({}, envOptsNoTargets);
let convertESM = true; let convertESM = true;
let ignoreLib = true; let ignoreLib = true;
@ -97,6 +98,11 @@ module.exports = function(api) {
convertESM ? "@babel/transform-modules-commonjs" : null, convertESM ? "@babel/transform-modules-commonjs" : null,
].filter(Boolean), ].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 // The vast majority of our src files are modules, but we use
// unambiguous to keep things simple until we get around to renaming // unambiguous to keep things simple until we get around to renaming