-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack-prod.js
44 lines (42 loc) · 1.22 KB
/
webpack-prod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use strict';
const commonConfig = require('./webpack.common.config.js');
const webpackMerge = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CompressionPlugin = require("compression-webpack-plugin");
const webpack = require('webpack');
module.exports = function (env) {
return webpackMerge(commonConfig(), {
entry: {
'prod': './app/bootstrap-prod.ts'
},
output: {
path: './dist/prod'
},
plugins: [
new HtmlWebpackPlugin({
template: 'index-prod.html',
inject: false
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
output: {
comments: false
},
sourceMap: false
}),
new CompressionPlugin({
asset: "[path].gz[query]",
algorithm: "gzip",
test: /\.js$|\.html$/,
threshold: 10240,
minRatio: 0.8
})
],
devServer: {
contentBase: 'dist/prod'
},
bail: false
});
};