Last active
October 20, 2016 21:32
-
-
Save bitttttten/f445a49ea1c4c11e871b0861a15084b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack') | |
const HtmlWebpackPlugin = require('html-webpack-plugin') | |
const loaders = require('./loaders.js') | |
module.exports = { | |
bail: true, | |
target: 'web', | |
entry: './app/client.js', | |
output: { | |
path: './build/', | |
filename: '[name].[chunkhash:8].js', | |
publicPath: '/', | |
}, | |
devtool: 'cheap-module-source-map', | |
module: { | |
loaders | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
inject: true, | |
template: './template/index.html', | |
minify: { | |
removeComments: true, | |
collapseWhitespace: true, | |
useShortDoctype: false, | |
removeEmptyAttributes: true, | |
removeStyleLinkTypeAttributes: true, | |
keepClosingSlash: true, | |
} | |
}), | |
new webpack.optimize.OccurrenceOrderPlugin(), | |
new webpack.NoErrorsPlugin(), | |
new webpack.optimize.DedupePlugin(), | |
new webpack.DefinePlugin({ | |
'process.env': { | |
'NODE_ENV': JSON.stringify('production') | |
} | |
}), | |
new webpack.optimize.UglifyJsPlugin({ | |
compress:{ | |
warnings: true | |
} | |
}), | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment