Skip to content

Commit 86c6658

Browse files
committed
separate forge configuration
1 parent 3e464d8 commit 86c6658

File tree

2 files changed

+52
-37
lines changed

2 files changed

+52
-37
lines changed

forge.config.js

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const path = require("path");
2+
const fs = require('fs');
3+
4+
module.exports = {
5+
packagerConfig: {
6+
packageManager: "npm",
7+
icon: "src/icons/icon",
8+
asar: true,
9+
overwrite: true,
10+
ignore: [
11+
"source",
12+
"compile.sh",
13+
"framework",
14+
"README*",
15+
"LICENSE",
16+
"doc",
17+
"dict.dic",
18+
".gitignore",
19+
".gitsubmodules",
20+
".github",
21+
".idea",
22+
".vscode"
23+
],
24+
extraResource: [
25+
"framework",
26+
"dict.dic"
27+
]
28+
},
29+
makers: [
30+
{
31+
name: "@electron-forge/maker-zip",
32+
platforms: [
33+
"darwin",
34+
"linux",
35+
"win32"
36+
]
37+
}
38+
],
39+
hooks: {
40+
"packageAfterPrune": async (forgeConfig, buildPath) => {
41+
if (process.platform === "win32") return;
42+
const url = path.join(buildPath, 'node_modules/@serialport/bindings-cpp/build/node_gyp_bins')
43+
fs.unlink(path.join(url, "python3"), (err) => {
44+
if (err) throw err;
45+
46+
fs.rmdir(url, (err) => {
47+
if (err) throw err;
48+
})
49+
});
50+
}
51+
}
52+
}

package.json

-37
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,6 @@
1010
"make": "electron-forge make"
1111
},
1212
"license": "AGPL-3.0",
13-
"config": {
14-
"forge": {
15-
"packagerConfig": {
16-
"packageManager": "npm",
17-
"icon": "src/icons/icon",
18-
"asar": true,
19-
"overwrite": true,
20-
"ignore": [
21-
"source",
22-
"compile.sh",
23-
"framework",
24-
"README*",
25-
"LICENSE",
26-
"doc",
27-
"dict.dic",
28-
".gitignore",
29-
".gitsubmodules",
30-
".idea",
31-
".vscode"
32-
],
33-
"extraResource": [
34-
"framework",
35-
"dict.dic"
36-
]
37-
},
38-
"makers": [
39-
{
40-
"name": "@electron-forge/maker-zip",
41-
"platforms": [
42-
"darwin",
43-
"linux",
44-
"win32"
45-
]
46-
}
47-
]
48-
}
49-
},
5013
"dependencies": {
5114
"serialport": "^10.5.0"
5215
},

0 commit comments

Comments
 (0)