Minify react in production

This commit is contained in:
Berkeley Martinez
2015-11-22 20:26:44 -08:00
parent 8aace767c0
commit c71636b629
3 changed files with 21 additions and 4 deletions

View File

@ -1,4 +1,7 @@
var path = require('path');
var webpack = require('webpack');
var __DEV__ = process.env.NODE_ENV !== 'production';
module.exports = {
entry: './client',
@ -27,5 +30,12 @@ module.exports = {
}
]
},
plugins: []
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(__DEV__ ? 'development' : 'production')
},
'__DEVTOOLS__': !__DEV__
})
]
};