diff options
Diffstat (limited to 'webapp/webpack.config.js')
-rw-r--r-- | webapp/webpack.config.js | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/webapp/webpack.config.js b/webapp/webpack.config.js index 4058abbd2..f1742e3ae 100644 --- a/webapp/webpack.config.js +++ b/webapp/webpack.config.js @@ -34,7 +34,7 @@ var config = { loaders: [ { test: /\.jsx?$/, - loader: 'babel', + loader: 'babel-loader', exclude: /(node_modules|non_npm_dependencies)/, query: { presets: [ @@ -49,15 +49,15 @@ var config = { { test: /\.json$/, exclude: /manifest\.json$/, - loader: 'json' + loader: 'json-loader' }, { test: /manifest\.json$/, - loader: 'file?name=files/[hash].[ext]' + loader: 'file-loader?name=files/[hash].[ext]' }, { test: /(node_modules|non_npm_dependencies)(\\|\/).+\.(js|jsx)$/, - loader: 'imports', + loader: 'imports-loader', query: { $: 'jquery', jQuery: 'jquery' @@ -65,22 +65,22 @@ var config = { }, { test: /\.scss$/, - loaders: ['style', 'css', 'sass'] + loaders: ['style-loader', 'css-loader', 'sass-loader'] }, { test: /\.css$/, - loaders: ['style', 'css'] + loaders: ['style-loader', 'css-loader'] }, { test: /\.(png|eot|tiff|svg|woff2|woff|ttf|gif|mp3|jpg)$/, loaders: [ - 'file?name=files/[hash].[ext]', - 'image-webpack' + 'file-loader?name=files/[hash].[ext]', + 'image-webpack-loader' ] }, { test: /\.html$/, - loader: 'html?attrs=link:href' + loader: 'html-loader?attrs=link:href' } ] }, @@ -88,13 +88,6 @@ var config = { new webpack.ProvidePlugin({ 'window.jQuery': 'jquery' }), - new CopyWebpackPlugin([ - {from: 'images/emoji', to: 'emoji'}, - {from: 'images/logo-email.png', to: 'images'}, - {from: 'images/circles.png', to: 'images'}, - {from: 'images/favicon', to: 'images/favicon'}, - {from: 'images/appIcons.png', to: 'images'} - ]), new webpack.LoaderOptionsPlugin({ minimize: !DEV, debug: false @@ -106,11 +99,6 @@ var config = { } } }), - new webpack.DefinePlugin({ - 'process.env': { - NODE_ENV: JSON.stringify('production') - } - }), new webpack.optimize.CommonsChunkPlugin({ minChunks: 2, children: true @@ -150,14 +138,19 @@ if (!DEV) { compress: { warnings: false }, - comments: false + comments: false, + sourceMap: true }) ); config.plugins.push( new webpack.optimize.OccurrenceOrderPlugin(true) ); config.plugins.push( - new webpack.optimize.DedupePlugin() + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify('production') + } + }) ); } @@ -167,7 +160,7 @@ if (TEST) { config.target = 'node'; config.externals = [nodeExternals()]; } else { - // For some reason this breaks mocha. So it goes here. + // For some reason these break mocha. So they go here. config.plugins.push( new HtmlWebpackPlugin({ filename: 'root.html', @@ -175,6 +168,15 @@ if (TEST) { template: 'root.html' }) ); + config.plugins.push( + new CopyWebpackPlugin([ + {from: 'images/emoji', to: 'emoji'}, + {from: 'images/logo-email.png', to: 'images'}, + {from: 'images/circles.png', to: 'images'}, + {from: 'images/favicon', to: 'images/favicon'}, + {from: 'images/appIcons.png', to: 'images'} + ]) + ); } module.exports = config; |