Initial commit
This commit is contained in:
33
webpack.config.prod.js
Normal file
33
webpack.config.prod.js
Normal file
@@ -0,0 +1,33 @@
|
||||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
|
||||
commonWebpackConfig = require('./webpack.config');
|
||||
|
||||
productionWebpackConfig = Object.assign(commonWebpackConfig, {
|
||||
cache: true,
|
||||
devtool: 'cheap-module-source-map',
|
||||
entry: './src/index',
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
filename: 'bundle.js',
|
||||
publicPath: '/static/'
|
||||
},
|
||||
});
|
||||
|
||||
productionWebpackConfig.plugins.push(new webpack.optimize.OccurenceOrderPlugin());
|
||||
productionWebpackConfig.plugins.push(
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
})
|
||||
);
|
||||
productionWebpackConfig.plugins.push(
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'NODE_ENV': JSON.stringify('production')
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
module.exports = productionWebpackConfig;
|
||||
Reference in New Issue
Block a user