diff --git a/.babelrc b/.babelrc index b9b1b50..121c10c 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,6 @@ { "presets": [ - ["es2015", {"loose": true}], + "es2015", "react" ], "plugins": [ @@ -10,7 +10,7 @@ "env": { "production": { "plugins": [ - ["transform-react-remove-prop-types", { removeImport: true }] + ["transform-react-remove-prop-types", {"removeImport": true}] ] } } diff --git a/webpack.config.js b/webpack.config.js index 8597a7d..65c4970 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -15,15 +15,30 @@ const loaders = [ { test: /\.js$/, loader: 'babel-loader', - include: [path.resolve('src')] + include: [path.resolve('src')], + options: { + presets: [ + ['es2015', {modules: false}], + 'react' + ], + plugins: [ + 'transform-object-rest-spread', + 'transform-class-properties' + ], + env: { + production: { + plugins: [ + ['transform-react-remove-prop-types', {removeImport: true}] + ] + } + } + } } ]; const definePlugin = new webpack.DefinePlugin({ - 'process.env': { - NODE_ENV: JSON.stringify(process.env.NODE_ENV) - } + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) }); @@ -113,11 +128,7 @@ const min = { }, plugins: [ definePlugin, - new webpack.optimize.UglifyJsPlugin({ - compressor: { - warnings: false - } - }) + new webpack.optimize.UglifyJsPlugin() ], module: {loaders}, resolve,