69 lines
1.8 KiB
JavaScript
69 lines
1.8 KiB
JavaScript
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
|
|
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
|
|
|
|
module.exports = {
|
|
packagerConfig: {
|
|
asar: true,
|
|
extraResource: [
|
|
'./resources/windows/x64/opencode.exe'
|
|
],
|
|
},
|
|
rebuildConfig: {},
|
|
makers: [
|
|
{
|
|
name: '@electron-forge/maker-squirrel',
|
|
config: {},
|
|
},
|
|
{
|
|
name: '@electron-forge/maker-zip',
|
|
platforms: ['darwin'],
|
|
},
|
|
{
|
|
name: '@electron-forge/maker-deb',
|
|
config: {},
|
|
},
|
|
{
|
|
name: '@electron-forge/maker-rpm',
|
|
config: {},
|
|
},
|
|
],
|
|
plugins: [
|
|
{
|
|
name: '@electron-forge/plugin-vite',
|
|
config: {
|
|
// `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
|
|
// If you are familiar with Vite configuration, it will look really familiar.
|
|
build: [
|
|
{
|
|
entry: 'src/main/index.js',
|
|
config: 'vite.main.config.mjs',
|
|
target: 'main',
|
|
},
|
|
{
|
|
entry: 'src/preload/index.js',
|
|
config: 'vite.preload.config.mjs',
|
|
target: 'preload',
|
|
},
|
|
],
|
|
renderer: [
|
|
{
|
|
name: 'main_window',
|
|
config: 'vite.renderer.config.mjs',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
// 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,
|
|
}),
|
|
],
|
|
};
|