From e4072752bca4c8dd9ba059d809a3b334fe557c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 15 Apr 2019 20:01:16 +0200 Subject: [PATCH] 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 --- babel.config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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