From 3b1bab90ae252b11de08b7dab55175825294492f Mon Sep 17 00:00:00 2001 From: impressionyang Date: Wed, 20 May 2026 17:02:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Electron=20?= =?UTF-8?q?=E4=B8=BB=E8=BF=9B=E7=A8=8B=E8=B7=AF=E5=BE=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=20GUI=20=E7=A9=BA=E7=99=BD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/electron-main.ts | 5 +++-- tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/electron-main.ts b/src/electron-main.ts index ab58baa..0bea529 100644 --- a/src/electron-main.ts +++ b/src/electron-main.ts @@ -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; diff --git a/tsconfig.json b/tsconfig.json index aca2703..c8ecc09 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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"] }