new webpack config

compresses (uglify) the bundle even more;
generate source map file for debug
This commit is contained in:
Mário C 2016-10-24 00:02:29 +01:00
parent c3891c18cf
commit 7adc0baeaf
1 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,4 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const htmlWebpackOptions = {
@ -8,7 +9,8 @@ module.exports = {
entry: "./app/index.js",
output: {
path: 'build',
filename: "bundle.js"
filename: "bundle.js",
sourceMapFilename: 'bundle.js.map'
},
module: {
loaders: [
@ -27,7 +29,18 @@ module.exports = {
{ test: /\.scss$/, loaders: ["style", "css", "sass"] }
]
},
devtool: 'sourcemap',
plugins: [
new HtmlWebpackPlugin(htmlWebpackOptions)
new HtmlWebpackPlugin(htmlWebpackOptions),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
output: {
comments: false,
semicolons: true
},
sourceMap: true
})
]
};