-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathforge.config.js
More file actions
103 lines (96 loc) · 2.49 KB
/
forge.config.js
File metadata and controls
103 lines (96 loc) · 2.49 KB
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
103
import { downloadIpfsClients } from './electron/before-pack.js';
const config = {
packagerConfig: {
name: '5chan',
executableName: '5chan',
appBundleId: '5chan.desktop',
icon: './public/icon', // electron-forge adds the correct extension per platform
// NOTE: asar is disabled because of a bug where electron-packager silently fails
// during asar creation with 5chan's large node_modules. The app works fine without it.
// TODO: investigate and fix the asar creation issue
asar: false,
// Exclude unnecessary files from the package
ignore: [
/^\/src$/,
/^\/public$/,
/^\/android$/,
/^\/\.github$/,
/^\/scripts$/,
/^\/\.git/,
/^\/\.plebbit$/,
/^\/out$/,
/^\/dist$/,
/^\/squashfs-root$/,
/\.map$/,
/\.md$/,
/\.ts$/,
/tsconfig\.json$/,
/\.oxfmtrc/,
/oxlintrc/,
/vite\.config/,
/forge\.config/,
/capacitor\.config/,
/\.env$/,
/\.DS_Store$/,
/yarn\.lock$/,
// Exclude build-time scripts from the package
/electron\/before-pack\.js/,
// kubo npm package creates symlinks that break build - exclude its bin dir
// (we download our own kubo binary in generateAssets hook)
/node_modules\/kubo\/bin/,
// Exclude .bin directories anywhere in node_modules (contain escaping symlinks)
/node_modules\/.*\/\.bin/,
/node_modules\/\.bin/,
/node_modules\/\.cache/,
],
},
rebuildConfig: {
force: true,
},
hooks: {
// Download IPFS/Kubo binaries before packaging
generateAssets: async () => {
console.log('Downloading IPFS clients...');
await downloadIpfsClients();
console.log('IPFS clients downloaded.');
},
},
makers: [
// macOS
{
name: '@electron-forge/maker-dmg',
platforms: ['darwin'],
config: {
name: '5chan',
icon: './public/icon.icns',
format: 'ULFO',
},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
// Windows
{
name: '@electron-forge/maker-squirrel',
platforms: ['win32'],
config: {
name: '5chan',
setupIcon: './public/windows-icon.ico',
},
},
// Linux
{
name: '@reforged/maker-appimage',
platforms: ['linux'],
config: {
options: {
name: '5chan',
icon: './public/icon.png',
categories: ['Network'],
},
},
},
],
};
export default config;