-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
webpack.config.js
51 lines (49 loc) · 1.3 KB
/
webpack.config.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
45
46
47
48
49
50
51
"use strict"
const {join} = require("path")
const TerserPlugin = require("terser-webpack-plugin")
module.exports = [{
"entry": {
"main": "./app/index.js",
"preload": "./app/preload/index.js",
"renderer": "./app/renderer/index.js"
},
"externals": {
"bufferutil": "commonjs bufferutil",
"canvas": "{}",
"electron": "require('electron')",
"utf-8-validate": "commonjs utf-8-validate"
},
"mode": "production",
"node": {
"__dirname": false
},
"optimization": {
"minimize": true,
"minimizer": [
new TerserPlugin({
"extractComments": /Copyright/,
"terserOptions": {
"format": {
"comments": false
}
}
})
],
"moduleIds": "named"
},
"output": {
"clean": true,
/**
* Translate the chunk name to the right path (subfolder or not).
* @param {{chunk: {name: string}}} data
*/
"filename": data => {
if (data.chunk.name === "main") {
return "index.js"
}
return `${data.chunk.name}/index.js`
},
"path": join(__dirname, "build")
},
"target": "node"
}]