diff --git a/config/babel-preset-webpack.js b/config/babel-preset-webpack.js index 48cfb87..dec3da5 100644 --- a/config/babel-preset-webpack.js +++ b/config/babel-preset-webpack.js @@ -2,37 +2,7 @@ const browsers = require('./browsers'); -module.exports = function(env) { - const plugins = [ - // class { handleClick = () => { } } - require.resolve('babel-plugin-transform-class-properties'), - - // The following two plugins use Object.assign directly, instead of Babel's - // extends helper. Note that this assumes `Object.assign` is available. - // { ...todo, completed: true } - [require.resolve('babel-plugin-transform-object-rest-spread'), { - useBuiltIns: true, - }], - - // Transforms JSX - [require.resolve('babel-plugin-transform-react-jsx'), { - useBuiltIns: true, - pragma: 'h', - }], - ]; - - if (env === 'production') { - return { - presets: [ - // Latest stable ECMAScript features - // Disable ES6 Modules transpilation since Webpack supports them natively - [require.resolve('babel-preset-latest'), { - modules: false, - }], - ], - plugins, - }; - } +module.exports = function() { return { presets: [ // ES features necessary for user’s browsers @@ -44,6 +14,22 @@ module.exports = function(env) { modules: false, }], ], - plugins, + plugins: [ + // class { handleClick = () => { } } + require.resolve('babel-plugin-transform-class-properties'), + + // The following two plugins use Object.assign directly, instead of Babel's + // extends helper. Note that this assumes `Object.assign` is available. + // { ...todo, completed: true } + [require.resolve('babel-plugin-transform-object-rest-spread'), { + useBuiltIns: true, + }], + + // Transforms JSX + [require.resolve('babel-plugin-transform-react-jsx'), { + useBuiltIns: true, + pragma: 'h', + }], + ], }; }; diff --git a/config/webpack.config.js b/config/webpack.config.js index f2e10c8..26a584b 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -55,7 +55,7 @@ module.exports = function(scripts, env, options) { ignoreOrder: true, }), new webpack.DefinePlugin({ - 'DEBUG': JSON.stringify(isDev), + DEBUG: JSON.stringify(isDev), 'process.env': { NODE_ENV: JSON.stringify(env), },