Changed to now use a prod and a dev webpack config. Our prod config now minifies and sets up caching for us. Package json now has build command.

This commit is contained in:
2017-10-24 23:01:44 +02:00
parent c6fac11b8d
commit d10b974545
5 changed files with 84 additions and 35 deletions

28
client/webpack.prod.js Normal file
View File

@@ -0,0 +1,28 @@
/*
* @Author: KevinMidboe
* @Date: 2017-06-01 19:09:16
* @Last Modified by: KevinMidboe
* @Last Modified time: 2017-10-24 22:26:29
*/
const merge = require('webpack-merge');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const common = require('./webpack.common.js');
var webpack = require('webpack')
module.exports = merge(common, {
plugins: [
new UglifyJSPlugin(),
new HtmlWebpackPlugin({
template: './app/index.html',
title: 'Caching'
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
}),
],
output: {
filename: '[name].[chunkhash].js',
}
});