Skip to content

Commit ff37dff

Browse files
committed
Added Webpack configuration for production build.
1 parent b0f0210 commit ff37dff

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'),
@@ -20,5 +21,13 @@ module.exports = {
2021
output: {
2122
path: path.join(__dirname, 'webpack_out'),
2223
filename: 'minimalistic_react.js'
23-
}
24+
},
25+
plugins: [
26+
new webpack.optimize.UglifyJsPlugin,
27+
new webpack.optimize.DedupePlugin,
28+
new webpack.DefinePlugin({'process.env': {
29+
'NODE_ENV': JSON.stringify('production')
30+
}
31+
})
32+
]
2433
};

0 commit comments

Comments
 (0)