forked from chaiNNer-org/chaiNNer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
forge.config.js
102 lines (101 loc) · 3.23 KB
/
forge.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
const AdmZip = require('adm-zip');
module.exports = {
packagerConfig: {
executableName: 'chainner',
extraResource: './backend/src/',
icon: './src/public/icons/cross_platform/icon',
},
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: 'chaiNNer-org',
name: 'chaiNNer',
},
},
draft: true,
prerelease: true,
},
],
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
name: 'chainner',
iconUrl:
'https://github.com/chaiNNer-org/chaiNNer/blob/main/src/public/icons/win/icon.ico',
setupIcon: './src/public/icons/win/icon.ico',
loadingGif: './src/public/icons/win/installing_loop.gif',
},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin', 'linux', 'win32'],
},
{
name: '@electron-forge/maker-dmg',
config: {
format: 'ULFO',
name: 'chaiNNer',
icon: './src/public/icons/mac/icon.icns',
},
},
{
name: '@electron-forge/maker-deb',
config: {
name: 'chainner',
options: {
icon: './src/public/icons/cross_platform/icon.png',
},
},
},
{
name: '@electron-forge/maker-rpm',
config: {
name: 'chainner',
options: {
icon: './src/public/icons/cross_platform/icon.png',
},
},
},
],
plugins: [
{
name: '@electron-forge/plugin-webpack',
config: {
mainConfig: './webpack.main.config.js',
renderer: {
config: './webpack.renderer.config.js',
nodeIntegration: true,
contextIsolation: false,
entryPoints: [
{
html: './src/renderer/index.html',
js: './src/renderer/renderer.js',
name: 'main_window',
},
{
html: './src/renderer/splash.html',
js: './src/renderer/splash_renderer.js',
name: 'splash_screen',
},
],
},
devContentSecurityPolicy: '',
},
},
],
hooks: {
postMake: async (forgeConfig, makeResults) => {
const justArtifacts = makeResults.map((m) => m.artifacts).reduce((a, b) => a.concat(b));
const zipArtifact = justArtifacts.find((a) => a.endsWith('.zip'));
if (zipArtifact) {
// Add an empty `portable` file to the zip
const zip = new AdmZip(zipArtifact);
zip.addFile('portable', Buffer.alloc(0));
zip.writeZip(zipArtifact);
}
},
},
};