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:
28
client/webpack.prod.js
Normal file
28
client/webpack.prod.js
Normal 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',
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user