Skip to content

Commit 2feaed2

Browse files
author
vinogradov
committedMar 12, 2017
update versions and improve webpack production compression
1 parent 2209399 commit 2feaed2

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed
 

‎package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,28 @@
1212
"license": "MIT",
1313
"dependencies": {
1414
"babel-core": "6.23.1",
15-
"babel-loader": "6.3.2",
16-
"babel-preset-env": "1.1.11",
15+
"babel-loader": "6.4.0",
16+
"babel-preset-env": "1.2.1",
1717
"babel-preset-react": "6.23.0",
1818
"clean-webpack-plugin": "0.1.15",
19-
"css-loader": "0.26.2",
20-
"eslint": "3.16.1",
19+
"css-loader": "0.27.2",
20+
"eslint": "3.17.1",
2121
"eslint-loader": "1.6.3",
2222
"eslint-plugin-react": "6.10.0",
23-
"extract-text-webpack-plugin": "2.0.0",
23+
"extract-text-webpack-plugin": "2.1.0",
2424
"file-loader": "0.10.1",
2525
"html-webpack-plugin": "2.28.0",
2626
"node-sass": "4.5.0",
2727
"react": "15.4.2",
2828
"react-dom": "15.4.2",
29-
"sass-loader": "6.0.2",
29+
"sass-loader": "6.0.3",
3030
"style-loader": "0.13.2",
3131
"webpack": "2.2.1"
3232
},
3333
"devDependencies": {
3434
"webpack-dev-server": "2.4.1"
35+
},
36+
"engines" : {
37+
"node" : ">=7.5.0"
3538
}
3639
}

‎webpack.config.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ var plugins = [
2828

2929
module.exports = function (env) {
3030
if (env && env.dist) {
31+
// https://webpack.js.org/guides/production-build/
3132
var webpack = require('webpack');
3233

33-
var uglifyJsPlugin = new webpack.optimize.UglifyJsPlugin({
34+
plugins.push(new webpack.optimize.UglifyJsPlugin({
35+
beautify: false,
3436
mangle: true,
3537
comments: false
36-
});
38+
}));
3739

38-
plugins.push(uglifyJsPlugin);
40+
plugins.push(new webpack.DefinePlugin({
41+
'process.env.NODE_ENV': JSON.stringify('production')
42+
}));
3943
}
4044

4145
return {

0 commit comments

Comments
 (0)
Please sign in to comment.