mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-08-28 19:46:50 +08:00
make find-chrome-bin as external dependencies to resolve production build runtime error
This commit is contained in:
+17
-1
@@ -1,7 +1,23 @@
|
||||
import { findChrome } from "find-chrome-bin";
|
||||
import { is } from '@electron-toolkit/utils'
|
||||
import electron from 'electron'
|
||||
import * as os from 'node:os'
|
||||
import path from 'node:path'
|
||||
|
||||
export default async function findAndLocateExistedChromiumExecutable() {
|
||||
let findChrome: typeof import('find-chrome-bin').findChrome
|
||||
if (is.dev) {
|
||||
findChrome = (await import('find-chrome-bin')).findChrome
|
||||
} else {
|
||||
findChrome = (
|
||||
await import(
|
||||
path.resolve(
|
||||
electron.app.getAppPath(),
|
||||
'..',
|
||||
'external-node-runtime-dependencies/index.mjs'
|
||||
)
|
||||
)
|
||||
).findChromeBin.findChrome
|
||||
}
|
||||
// For windows, try to find Edge(chromium)
|
||||
if (os.platform() === 'win32') {
|
||||
// TODO: handle windows
|
||||
|
||||
Reference in New Issue
Block a user