-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
51 lines (48 loc) · 1.24 KB
/
webpack.config.ts
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
45
46
47
48
49
50
51
/* eslint-disable @typescript-eslint/naming-convention */
import * as webpack from 'webpack';
import {
CustomWebpackBrowserSchema,
TargetOptions
} from '@angular-builders/custom-webpack';
import { default as TerserPlugin } from 'terser-webpack-plugin';
export default (
config: webpack.Configuration,
_options: CustomWebpackBrowserSchema,
_targetOptions: TargetOptions
) => {
if (config.mode === 'production') {
config.optimization = {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
ecma: 2017,
compress: {
drop_console: true,
drop_debugger: true,
ecma: 2017,
keep_classnames: true,
keep_fnames: true,
module: true,
toplevel: true,
keep_infinity: true
},
mangle: {
keep_classnames: true,
keep_fnames: true,
module: true,
toplevel: true
},
module: true,
toplevel: true,
ie8: false,
keep_classnames: true,
keep_fnames: true
}
})
]
};
}
return config;
};