-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforge.config.ts
164 lines (159 loc) · 6.04 KB
/
forge.config.ts
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import * as path from 'node:path'
import { FuseV1Options, FuseVersion } from '@electron/fuses'
import type { ForgeConfig } from '@electron-forge/shared-types'
import { FusesPlugin } from '@electron-forge/plugin-fuses'
import { MakerDMG } from '@electron-forge/maker-dmg'
import { MakerDeb } from '@electron-forge/maker-deb'
import { MakerRpm } from '@electron-forge/maker-rpm'
import { MakerZIP } from '@electron-forge/maker-zip'
import { WebpackPlugin } from '@electron-forge/plugin-webpack'
import { mainConfig } from './webpack.main.config'
import packageJson from './package.json'
import { rendererConfig } from './webpack.renderer.config'
const { version } = packageJson
const config: ForgeConfig = {
packagerConfig: {
executableName:
process.platform === 'linux' ? 'ecoindex-app' : 'EcoindexApp',
appBundleId: 'io.greenit.ecoindex-ligthouse',
appCategoryType: 'public.app-category.developer-tools',
appCopyright: 'Copyright 2024-2030 Green IT',
darwinDarkModeSupport: true,
asar: true,
icon: path.resolve(__dirname, 'assets', 'app-ico'),
extraResource: [
'./src/extraResources/scripts',
'./src/extraResources/md',
'./src/locales',
'./node_modules/puppeteer',
],
win32metadata: {
CompanyName: 'Green IT',
OriginalFilename: 'Ecoindex',
},
osxSign: {
optionsForFile: (filePath) => {
// Here, we keep it simple and return a single entitlements.plist file.
// You can use this callback to map different sets of entitlements
// to specific files in your packaged app.
return {
entitlements: './assets/default.darwin.plist',
hardenedRuntime: true,
}
},
identity: 'Developer ID Application: Renaud Héluin (ARQGHNC9UG)',
},
osxNotarize: {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
appleId: process.env.APPLE_ID,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
appleIdPassword: process.env.APPLE_PASSWORD,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
teamId: process.env.APPLE_TEAM_ID,
},
},
rebuildConfig: {},
makers: [
new MakerRpm(
{
options: {
homepage: 'https://github.com/cnumr/EcoindexApp',
},
},
['linux']
),
new MakerZIP({}, ['darwin', 'linux', 'win32']),
new MakerDMG(
{
format: 'ULFO',
background: path.resolve(__dirname, 'assets', 'dmgbg.png'),
icon: path.resolve(__dirname, 'assets', 'app-ico.icns'),
overwrite: true,
} as any, // type of MakerDMGConfig omits `appPath`
['darwin']
),
{
name: '@electron-forge/maker-squirrel',
platforms: ['win32'],
config: (arch: string) => {
return {
setupExe: `ecoindex-app-${version}-win32-${arch}-setup.exe`,
setupIcon: path.resolve(__dirname, 'assets', 'app-ico.ico'),
// certificateFile: './cert.pfx',
// certificatePassword: process.env.CERTIFICATE_PASSWORD,
authors: 'Renaud Heluin',
description:
'An application to measure the ecological impact of a website with LightHouse and Ecoindex.',
language: 1033,
name: `Ecoindex`,
}
},
},
new MakerDeb(
{
options: {
categories: ['Utility'],
maintainer: 'Renaud Héluin',
homepage: 'https://github.com/cnumr/EcoindexApp',
},
},
['linux']
),
// {
// name: '@electron-forge/maker-deb',
// config: {
// options: {
// maintainer: 'Renaud Héluin',
// homepage: 'https://asso.greenit.fr',
// },
// },
// },
],
publishers: [],
plugins: [
// new AutoUnpackNativesPlugin({}),
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
new WebpackPlugin({
mainConfig,
renderer: {
config: rendererConfig,
entryPoints: [
{
html: './src/renderer/MainWindow/index.html',
js: './src/renderer/MainWindow/renderer.ts',
name: 'main_window',
preload: {
js: './src/renderer/MainWindow/preload.ts',
},
},
{
html: './src/renderer/HelloWindow/index.html',
js: './src/renderer/HelloWindow/renderer.ts',
name: 'hello_window',
preload: {
js: './src/renderer/HelloWindow/preload.ts',
},
},
],
},
}),
// Fuses are used to enable/disable various Electron functionality
// at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
}),
],
}
export default config