Skip to content

Commit

Permalink
Added Webpack configuration for production build.
Browse files Browse the repository at this point in the history
  • Loading branch information
maratbn committed Jun 24, 2018
1 parent 615d415 commit 7f17473
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions webpack.config.js
Expand Up @@ -3,7 +3,8 @@
// http://maratbn.com/blogs/2018/06/17/minimalistic-react-webapp-webpack-3/ // http://maratbn.com/blogs/2018/06/17/minimalistic-react-webapp-webpack-3/




const path = require('path'); const path = require('path'),
webpack = require('webpack');


module.exports = { module.exports = {
entry: [path.join(__dirname, 'webpack_in', 'entry.js'), entry: [path.join(__dirname, 'webpack_in', 'entry.js'),
Expand All @@ -26,5 +27,12 @@ module.exports = {
output: { output: {
path: path.join(__dirname, 'webpack_out'), path: path.join(__dirname, 'webpack_out'),
filename: 'minimalistic_react.js' filename: 'minimalistic_react.js'
} },
plugins: [
new webpack.optimize.UglifyJsPlugin,
new webpack.DefinePlugin({'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
]
}; };

0 comments on commit 7f17473

Please sign in to comment.