-
Notifications
You must be signed in to change notification settings - Fork 21
/
webpack.config.cjs
62 lines (60 loc) · 1.39 KB
/
webpack.config.cjs
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
52
53
54
55
56
57
58
59
60
61
62
const TerserPlugin = require("terser-webpack-plugin");
const webpack = require("webpack");
const customPlugins = require("./plugins/webpack");
const optimization = {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
format: {
comments: false,
},
},
extractComments: false,
}),
],
};
module.exports = [
{
name: "background",
mode: "production",
entry: "./dist/src/background/index.js",
target: "node",
output: {
filename: "background.js",
path: __dirname + "/dist/packed",
libraryTarget: "commonjs2",
},
externals: ["electron"],
optimization,
},
{
name: "preload",
mode: "production",
entry: "./dist/src/renderer/ipc/preload.js",
output: {
filename: "preload.js",
path: __dirname + "/dist/packed",
libraryTarget: "commonjs",
},
externals: ["electron"],
optimization,
},
{
name: "command:usi-csa-bridge",
mode: "production",
entry: "./dist/src/command/usi-csa-bridge/index.js",
target: "node",
output: {
filename: "index.js",
path: __dirname + "/dist/command/usi-csa-bridge",
libraryTarget: "commonjs2",
},
externals: /^[^.].*$/,
optimization,
plugins: [
new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }),
customPlugins.AddExecPermission,
],
},
];