-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathwebpack.prod.js
44 lines (40 loc) · 959 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
41
42
43
44
// @ts-check
const ESLintPlugin = require("eslint-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const { merge } = require("webpack-merge");
const baseConfigs = require("./webpack.config.js");
const [main, vnc] = baseConfigs;
module.exports = [
merge(main, {
mode: "production",
devtool: "source-map",
// TODO figure out minifying lit templates
optimization: {
runtimeChunk: "single",
splitChunks: {
// Split both async and non-async chunks (only async by default)
chunks: "all",
},
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
drop_console: ["log", "info"],
},
},
}),
],
},
plugins: [
new ESLintPlugin({
failOnWarning: true,
extensions: ["ts", "js"],
}),
],
}),
{
...vnc,
mode: "production",
},
];