Skip to content

Commit

Permalink
Fix production build
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Feb 16, 2017
1 parent 95f2cb9 commit 392ef77
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,7 +7,7 @@
"main": "index.js",
"scripts": {
"assets:watch": "webpack -c -d --progress --watch",
"assets:build": "webpack -p --progress --config webpack.config.prod.js",
"assets:build": "webpack --progress --config webpack.config.prod.js",
"widgets:watch": "webpack -c -d --progress --watch --config webpack.config.widgets.js",
"widgets:build": "webpack -p --progress --config webpack.config.widgets.prod.js",
"build": "npm run assets:build && npm run widgets:build",
Expand Down
41 changes: 24 additions & 17 deletions webpack.config.prod.js
@@ -1,26 +1,33 @@
var webpack = require('webpack');
var config = require('./webpack.config');

config.plugins.push(new webpack.optimize.UglifyJsPlugin({
minimize: true,
output: {
comments: false,
screw_ie8: true
},
mangle: {
screw_ie8: true
},
compress: {
warnings: false,
screw_ie8: true
}
}));
config.plugins.push(
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
minimize: true,
output: {
comments: false,
screw_ie8: true
},
mangle: {
screw_ie8: true,
keep_fnames: true
},
compress: {
warnings: false,
screw_ie8: true
}
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(true)
);

config.devtool = 'source-map';

config.plugins.push(new webpack.optimize.DedupePlugin());
config.plugins.push(new webpack.optimize.OccurenceOrderPlugin(true));

/**
* Image optimization.
* Not working yet
Expand Down

0 comments on commit 392ef77

Please sign in to comment.