Use HtmlWebpackPlugin for eployments

This commit is contained in:
Jori Lallo
2016-05-23 20:35:19 -07:00
parent 9506dcbca6
commit 67ca3c2ae2
7 changed files with 21 additions and 17 deletions

View File

@@ -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({