diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000000..e8ccfd2347 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1 @@ +>2%, last 2 versions, Firefox ESR \ No newline at end of file diff --git a/babel.config.js b/babel.config.js index 04a5197976..259d889525 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,17 +1,18 @@ -module.exports = { - plugins: [ - '@babel/plugin-syntax-dynamic-import', // add support for dynamic imports (used in app.js) - 'lodash', // Tree-shake lodash - ], - presets: [ - ['@babel/preset-env', { - //debug: true, - loose: true, // Enable "loose" transformations for any plugins in this preset that allow them - modules: 'auto', - useBuiltIns: 'usage', // Tree-shake babel-polyfill - targets: { - node: 'current', - }, - }], - ], -}; \ No newline at end of file +module.exports = api => { + const targets = api.env('test') ? { targets: { node: 'current' } } : null; + return { + plugins: [ + '@babel/plugin-syntax-dynamic-import', // add support for dynamic imports (used in app.js) + 'lodash', // Tree-shake lodash + ], + presets: [ + ['@babel/preset-env', { + //debug: true, + loose: true, // Enable "loose" transformations for any plugins in this preset that allow them + modules: 'auto', + useBuiltIns: 'usage', // Tree-shake babel-polyfill + ...targets, + }], + ], + }; +} diff --git a/webpack.common.js b/webpack.common.js index 4a8ba21051..7603dff18b 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -30,7 +30,6 @@ module.exports = { loose: true, // Enable "loose" transformations for any plugins in this preset that allow them modules: false, // Don't transform modules; needed for tree-shaking useBuiltIns: 'entry', - targets: '> 1%, last 2 versions, Firefox ESR', corejs: '^3.6.5', }], ],