-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
40 lines (37 loc) · 982 Bytes
/
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
const TerserPlugin = require("terser-webpack-plugin");
const merge = require("webpack-merge");
const [commonApp, commonWorker] = require("./webpack.common.js");
const simpleApps = require("./simple/webpack.js");
const pages = [commonApp, ...simpleApps].map(p =>
merge(p, {
mode: "production",
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
keep_classnames: true
}
})
]
}
})
);
const worker = {
mode: "production",
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: {
keep_classnames: true
}
})
]
}
};
module.exports = [...pages, merge(commonWorker, worker)];