Skip to content

Commit 20f4fad

Browse files
committed
Added Webpack configuration for production build.
1 parent 8d0982d commit 20f4fad

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

webpack.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// http://maratbn.com/blogs/2017/01/14/minimalistic-react-webapp/
44

55

6-
const path = require('path');
6+
const path = require('path'),
7+
webpack = require('webpack');
78

89
module.exports = {
910
entry: [path.join(__dirname, 'webpack_in', 'entry.js'),
@@ -26,5 +27,13 @@ module.exports = {
2627
output: {
2728
path: path.join(__dirname, 'webpack_out'),
2829
filename: 'minimalistic_react.js'
29-
}
30+
},
31+
plugins: [
32+
new webpack.optimize.UglifyJsPlugin,
33+
new webpack.optimize.DedupePlugin,
34+
new webpack.DefinePlugin({'process.env': {
35+
'NODE_ENV': JSON.stringify('production')
36+
}
37+
})
38+
]
3039
};

0 commit comments

Comments
 (0)