Skip to content

Commit

Permalink
feat: allow custom electron forks in startup call
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatKawaiiSam committed Apr 15, 2024
1 parent 06d8144 commit dbc85dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,17 @@ export default function electron(options: ElectronOptions | ElectronOptions[]):
* Electron App startup function.
* It will mount the Electron App child-process to `process.electronApp`.
* @param argv default value `['.', '--no-sandbox']`
* @param options options for `child_process.spawn`
* @param customElectronPkg custom electron package name (default: 'electron')
*/
export async function startup(
argv = ['.', '--no-sandbox'],
options?: import('node:child_process').SpawnOptions,
customElectronPkg?: string,
) {
const { spawn } = await import('node:child_process')
// @ts-ignore
const electron = await import('electron')
const electron = await import(customElectronPkg ?? 'electron')
const electronPath = <any>(electron.default ?? electron)

await startup.exit()
Expand Down

0 comments on commit dbc85dc

Please sign in to comment.