-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
37 lines (31 loc) · 967 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
// -----------------------------------------------------------------------------------
// Copyright 2021, Gilles Zunino
// -----------------------------------------------------------------------------------
"use strict";
const { merge } = require("webpack-merge");
const TerserPlugin = require("terser-webpack-plugin");
// Common webpack configuration / utilities
const common = require("./webpack.common.js");
// We are building for production
const type = common.PRODUCTION;
module.exports = merge(common.getCommonConfiguration(type), {
mode: type,
target: "node",
devtool: false,
optimization: {
minimize: true
},
plugins: [
new TerserPlugin({
test: /\.js($|\?)/i,
parallel: true,
terserOptions: {
warnings: false,
toplevel: true,
compress: {
dead_code: true
}
}
})
]
});