From 907aae3fd1654329e3934aa63e214d14d412afc9 Mon Sep 17 00:00:00 2001 From: Abdelmajid Date: Wed, 11 Dec 2019 16:51:23 +0100 Subject: [PATCH 1/2] Added shippedProposals --- packages/babel-preset-default/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/babel-preset-default/index.js b/packages/babel-preset-default/index.js index a1343706b03b8..91282a31772bd 100644 --- a/packages/babel-preset-default/index.js +++ b/packages/babel-preset-default/index.js @@ -31,6 +31,7 @@ module.exports = function( api ) { if ( isWPBuild( wpBuildOpts.name ) ) { opts.modules = wpBuildOpts.modules; } + opts.shippedProposals = true; return [ require.resolve( '@babel/preset-env' ), opts ]; }; From db464174b8e5ba0980bb9afaf50802117509becf Mon Sep 17 00:00:00 2001 From: Abdelmajid Date: Thu, 12 Dec 2019 17:35:06 +0100 Subject: [PATCH 2/2] Setting shippedProposals during init --- packages/babel-preset-default/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/babel-preset-default/index.js b/packages/babel-preset-default/index.js index 91282a31772bd..b720c8a38c704 100644 --- a/packages/babel-preset-default/index.js +++ b/packages/babel-preset-default/index.js @@ -15,7 +15,9 @@ module.exports = function( api ) { } ); const getPresetEnv = () => { - const opts = {}; + const opts = { + shippedProposals: true, + }; if ( isTestEnv ) { opts.targets = { @@ -31,7 +33,6 @@ module.exports = function( api ) { if ( isWPBuild( wpBuildOpts.name ) ) { opts.modules = wpBuildOpts.modules; } - opts.shippedProposals = true; return [ require.resolve( '@babel/preset-env' ), opts ]; };