build: conditionally include plugins based on start command in forge.config.ts
This commit is contained in:
1 parent
f636dd61a5
commit
f37127d385
1 file changed
+16
-11
+16
-11
@@ -12,6 +12,8 @@ import * as path from 'path';
|
|||||||
|
|
||||||
const nativeModules = ['better-sqlite3', 'keytar', 'bindings', 'file-uri-to-path'];
|
const nativeModules = ['better-sqlite3', 'keytar', 'bindings', 'file-uri-to-path'];
|
||||||
|
|
||||||
|
const isStartCommand = process.argv.some((arg) => arg.includes('start'));
|
||||||
|
|
||||||
const config: ForgeConfig = {
|
const config: ForgeConfig = {
|
||||||
packagerConfig: {
|
packagerConfig: {
|
||||||
asar: {
|
asar: {
|
||||||
@@ -80,7 +82,6 @@ const config: ForgeConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
new AutoUnpackNativesPlugin({}),
|
|
||||||
new VitePlugin({
|
new VitePlugin({
|
||||||
build: [
|
build: [
|
||||||
{
|
{
|
||||||
@@ -101,16 +102,20 @@ const config: ForgeConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
...(!isStartCommand
|
||||||
new FusesPlugin({
|
? [
|
||||||
version: FuseVersion.V1,
|
new AutoUnpackNativesPlugin({}),
|
||||||
[FuseV1Options.RunAsNode]: false,
|
new FusesPlugin({
|
||||||
[FuseV1Options.EnableCookieEncryption]: true,
|
version: FuseVersion.V1,
|
||||||
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
[FuseV1Options.RunAsNode]: false,
|
||||||
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
[FuseV1Options.EnableCookieEncryption]: true,
|
||||||
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
||||||
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
||||||
}),
|
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
||||||
|
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
: []),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user