diff --git a/electron/main/index.ts b/electron/main/index.ts index df835e1..cb29401 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -1,11 +1,12 @@ import { app, BrowserWindow, shell, ipcMain } from 'electron' +import { createRequire } from 'node:module' import { fileURLToPath } from 'node:url' import path from 'node:path' import os from 'node:os' import { update } from './update' -globalThis.__filename = fileURLToPath(import.meta.url) -globalThis.__dirname = path.dirname(__filename) +const require = createRequire(import.meta.url) +const __dirname = path.dirname(fileURLToPath(import.meta.url)) // The built directory structure //