Skip to content

Commit 224800a

Browse files
fix(main): define __dirname in ESM environment
1 parent d29f47d commit 224800a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/main/index.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { app, BrowserWindow } from 'electron';
2-
import path from 'path';
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
34
import { registerIpcHandlers } from './ipc';
45

6+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
7+
58
// Disable hardware acceleration issues if running in some VM environments
69
app.disableHardwareAcceleration();
710

0 commit comments

Comments
 (0)