forge.config.ts
1 import type { ForgeConfig } from '@electron-forge/shared-types'; 2 import { MakerSquirrel } from '@electron-forge/maker-squirrel'; 3 import { MakerZIP } from '@electron-forge/maker-zip'; 4 import { MakerDeb } from '@electron-forge/maker-deb'; 5 import { MakerRpm } from '@electron-forge/maker-rpm'; 6 import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives'; 7 import { WebpackPlugin } from '@electron-forge/plugin-webpack'; 8 import { FusesPlugin } from '@electron-forge/plugin-fuses'; 9 import { FuseV1Options, FuseVersion } from '@electron/fuses'; 10 11 import { mainConfig } from './webpack.main.config'; 12 import { rendererConfig } from './webpack.renderer.config'; 13 14 const config: ForgeConfig = { 15 packagerConfig: { 16 asar: true, 17 }, 18 rebuildConfig: {}, 19 makers: [new MakerSquirrel({}), new MakerZIP({}, ['darwin']), new MakerRpm({}), new MakerDeb({})], 20 plugins: [ 21 new AutoUnpackNativesPlugin({}), 22 new WebpackPlugin({ 23 mainConfig, 24 renderer: { 25 config: rendererConfig, 26 entryPoints: [ 27 { 28 html: './src/index.html', 29 js: './src/renderer.ts', 30 name: 'main_window', 31 preload: { 32 js: './src/preload.ts', 33 }, 34 }, 35 ], 36 }, 37 }), 38 // Fuses are used to enable/disable various Electron functionality 39 // at package time, before code signing the application 40 new FusesPlugin({ 41 version: FuseVersion.V1, 42 [FuseV1Options.RunAsNode]: false, 43 [FuseV1Options.EnableCookieEncryption]: true, 44 [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false, 45 [FuseV1Options.EnableNodeCliInspectArguments]: false, 46 [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true, 47 [FuseV1Options.OnlyLoadAppFromAsar]: true, 48 }), 49 ], 50 }; 51 52 export default config;