-
-
Notifications
You must be signed in to change notification settings - Fork 306
/
forge.config.ts
121 lines (119 loc) · 3.37 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
import type { ForgeConfig } from '@electron-forge/shared-types';
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
import { MakerZIP } from '@electron-forge/maker-zip';
import { MakerDeb } from '@electron-forge/maker-deb';
import { MakerRpm } from '@electron-forge/maker-rpm';
import { MakerDMG } from '@electron-forge/maker-dmg';
import { MakerSnap } from '@electron-forge/maker-snap';
import { PublisherGithub } from '@electron-forge/publisher-github';
import { MakerAppImage } from '@reforged/maker-appimage';
import { WebpackPlugin } from '@electron-forge/plugin-webpack';
import path from 'node:path';
import { mainConfig } from './config/webpack.main.config';
import { rendererConfig } from './config/webpack.renderer.config';
import {
sourceMainPath,
sourceRendererPath,
assetsPath,
} from './config/webpack.paths';
import { version } from './package.json';
const config: ForgeConfig = {
packagerConfig: {
asar: false,
executableName: 'electrocrud',
name: 'ElectroCRUD',
appVersion: version,
appBundleId: 'com.garrylachman.electrocrud',
icon: path.resolve(assetsPath, 'icon'),
appCategoryType: 'public.app-category.developer-tools',
win32metadata: {
CompanyName: 'ElectroCRUD',
OriginalFilename: 'ElectroCRUD',
},
},
rebuildConfig: {},
makers: [
new MakerSquirrel(
{
authors: 'Garry Lachman',
name: 'electrocrud',
exe: 'electrocrud.exe',
noMsi: true,
setupExe: `electrocrud-${version}-win32-setup.exe`,
},
['win32']
),
new MakerZIP({}, ['darwin']),
new MakerDMG({}, ['darwin']),
new MakerRpm(
{
options: {
homepage: 'https://github.com/garrylachman/ElectroCRUD',
},
},
['linux']
),
new MakerDeb(
{
options: {
categories: ['Utility'],
maintainer: 'Garry Lachman',
homepage: 'https://github.com/garrylachman/ElectroCRUD',
},
},
['linux']
),
/*
new MakerAppImage({
options: {
categories: ['Utility'],
bin: 'electrocrud',
icon: 'assets/icon.png',
},
}),
*/
],
publishers: [
new PublisherGithub({
repository: {
owner: 'garrylachman',
name: 'electrocrud',
},
}),
],
plugins: [
new WebpackPlugin({
devServer: {
liveReload: false,
headers: { 'Access-Control-Allow-Origin': '*' },
historyApiFallback: { verbose: true },
},
// @ts-ignore
devContentSecurityPolicy: `default-src 'self' 'unsafe-inline' data: ws:; script-src 'self' 'unsafe-eval' 'unsafe-inline' data: http: ws:`,
// @ts-ignore
mainConfig,
renderer: {
// @ts-ignore
config: rendererConfig,
entryPoints: [
{
// @ts-ignore
rhmr: 'react-hot-loader/patch',
html: path.join(sourceRendererPath, 'index.html'),
js: path.join(sourceRendererPath, 'index.tsx'),
name: 'main_window',
preload: {
js: path.join(sourceMainPath, 'preload.ts'),
},
},
{
html: path.join(sourceRendererPath, 'splash-screen/index.html'),
js: path.join(sourceRendererPath, 'splash-screen/index.tsx'),
name: 'splash_screen',
},
],
},
}),
],
};
export default config;