2016-07-07 23:23:18 +02:00
|
|
|
var webpack = require("webpack");
|
|
|
|
var config = require("./webpack.config.base.js");
|
|
|
|
|
|
|
|
// Report first error as hard error
|
|
|
|
config.bail = true;
|
|
|
|
config.debug = false;
|
|
|
|
// Do not capture timing information for each module
|
|
|
|
config.profile = false;
|
|
|
|
// Emit source map
|
|
|
|
config.devtool = "#source-map";
|
|
|
|
|
|
|
|
config.plugins = config.plugins.concat([
|
2016-08-10 21:36:11 +02:00
|
|
|
new webpack.NoErrorsPlugin(), // Any error is considered a failure
|
|
|
|
new webpack.DefinePlugin({ // Set production environment variable
|
2016-07-26 15:59:18 +02:00
|
|
|
'process.env': {
|
|
|
|
'NODE_ENV': JSON.stringify('production')
|
|
|
|
}
|
|
|
|
}),
|
2016-08-10 21:36:11 +02:00
|
|
|
// Optimizations
|
2016-07-07 23:23:18 +02:00
|
|
|
new webpack.optimize.OccurenceOrderPlugin(true),
|
|
|
|
new webpack.optimize.DedupePlugin(),
|
2016-08-10 21:36:11 +02:00
|
|
|
// Minifications
|
2016-07-07 23:23:18 +02:00
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
output: {
|
|
|
|
comments: false
|
|
|
|
},
|
|
|
|
compress: {
|
|
|
|
warnings: false,
|
|
|
|
screw_ie8: true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
]);
|
|
|
|
|
|
|
|
module.exports = config;
|