Skip to content

Instantly share code, notes, and snippets.

@bitttttten
Last active October 20, 2016 21:32
Show Gist options
  • Save bitttttten/f445a49ea1c4c11e871b0861a15084b8 to your computer and use it in GitHub Desktop.
Save bitttttten/f445a49ea1c4c11e871b0861a15084b8 to your computer and use it in GitHub Desktop.
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