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