We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
globalThis.__dirname
1 parent 7d5708d commit f06b279Copy full SHA for f06b279
electron/main/index.ts
@@ -1,10 +1,11 @@
1
import { app, BrowserWindow, shell, ipcMain } from 'electron'
2
+import { createRequire } from 'node:module'
3
import { fileURLToPath } from 'node:url'
4
import path from 'node:path'
5
import os from 'node:os'
6
-globalThis.__filename = fileURLToPath(import.meta.url)
7
-globalThis.__dirname = path.dirname(__filename)
+const require = createRequire(import.meta.url)
8
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
9
10
// The built directory structure
11
//
0 commit comments