This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/webpack.config.prod.js

36 lines
789 B
JavaScript
Raw Normal View History

2016-02-27 21:53:11 +00:00
var path = require('path');
var webpack = require('webpack');
commonWebpackConfig = require('./webpack.config');
productionWebpackConfig = Object.assign(commonWebpackConfig, {
cache: true,
devtool: 'cheap-module-source-map',
2016-04-29 05:25:37 +00:00
entry: [
'./src/index',
],
2016-02-27 21:53:11 +00:00
output: {
path: path.join(__dirname, 'dist'),
2016-05-23 05:56:26 +00:00
filename: 'bundle.js',
2016-02-27 21:53:11 +00:00
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;