Use HtmlWebpackPlugin for eployments
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
commonWebpackConfig = require('./webpack.config');
|
||||
|
||||
@@ -11,11 +12,14 @@ productionWebpackConfig = Object.assign(commonWebpackConfig, {
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
filename: 'bundle.js',
|
||||
publicPath: '/static/'
|
||||
filename: 'bundle.[hash].js',
|
||||
publicPath: '/static/',
|
||||
},
|
||||
});
|
||||
|
||||
productionWebpackConfig.plugins.push(new HtmlWebpackPlugin({
|
||||
template: 'server/static/index.html'
|
||||
}));
|
||||
productionWebpackConfig.plugins.push(new webpack.optimize.OccurenceOrderPlugin());
|
||||
productionWebpackConfig.plugins.push(
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
|
||||
Reference in New Issue
Block a user