fix: 修复 Electron 主进程路径配置,解决 GUI 空白问题

This commit is contained in:
impressionyang 2026-05-20 17:02:00 +08:00
parent 3e8be47295
commit 3b1bab90ae
2 changed files with 4 additions and 3 deletions

View File

@ -4,10 +4,11 @@
*/
import { app, BrowserWindow, ipcMain, globalShortcut, clipboard } from 'electron';
import { join } from 'path';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
let mainWindow: BrowserWindow | null = null;

View File

@ -21,5 +21,5 @@
"allowSyntheticDefaultImports": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist", "test", "src/electron-main.ts", "src/preload.ts"]
"exclude": ["node_modules", "dist", "test"]
}