From a636b80e4408aeb5f1c9a1ba3243ed3e20e41913 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Thu, 31 May 2018 10:33:48 +0200 Subject: [PATCH] Build Tooling: Avoid using spread for objects to work with all node 8.x versions --- bin/packages/get-babel-config.js | 46 ++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/bin/packages/get-babel-config.js b/bin/packages/get-babel-config.js index 5dc04b0885eba..99fac50c9effd 100644 --- a/bin/packages/get-babel-config.js +++ b/bin/packages/get-babel-config.js @@ -20,26 +20,32 @@ const plugins = map( babelDefaultConfig.plugins, ( plugin ) => { } ); const babelConfigs = { - main: { - ...babelDefaultConfig, - babelrc: false, - plugins, - presets: map( babelDefaultConfig.presets, ( preset ) => { - if ( isArray( preset ) && preset[ 0 ] === babelPresetEnv ) { - return [ babelPresetEnv, Object.assign( - {}, - preset[ 1 ], - { modules: 'commonjs' } - ) ]; - } - return preset; - } ), - }, - module: { - ...babelDefaultConfig, - babelrc: false, - plugins, - }, + main: Object.assign( + {}, + babelDefaultConfig, + { + babelrc: false, + plugins, + presets: map( babelDefaultConfig.presets, ( preset ) => { + if ( isArray( preset ) && preset[ 0 ] === babelPresetEnv ) { + return [ babelPresetEnv, Object.assign( + {}, + preset[ 1 ], + { modules: 'commonjs' } + ) ]; + } + return preset; + } ), + } + ), + module: Object.assign( + {}, + babelDefaultConfig, + { + babelrc: false, + plugins, + } + ), }; function getBabelConfig( environment ) {