diff --git a/electron/main/index.ts b/electron/main/index.ts index cf02fc91..a95a3a26 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -1,10 +1,11 @@ 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' -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 //