Skip to content

Commit f06b279

Browse files
committed
chore: remove globalThis.__dirname
1 parent 7d5708d commit f06b279

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

electron/main/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { app, BrowserWindow, shell, ipcMain } from 'electron'
2+
import { createRequire } from 'node:module'
23
import { fileURLToPath } from 'node:url'
34
import path from 'node:path'
45
import os from 'node:os'
56

6-
globalThis.__filename = fileURLToPath(import.meta.url)
7-
globalThis.__dirname = path.dirname(__filename)
7+
const require = createRequire(import.meta.url)
8+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
89

910
// The built directory structure
1011
//

0 commit comments

Comments
 (0)