From 031bb81f732080d514582d63d31b625a6c06517c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20Wang=28=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7=29?= <308487730@qq.com> Date: Sun, 11 Feb 2024 10:54:10 +0800 Subject: [PATCH] feat: define `globalThis.__dirname` --- electron/main/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 2c282d2..1a126c1 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -4,8 +4,8 @@ import { dirname, join } from 'node:path' import { fileURLToPath } from 'node:url' import { update } from './update' -const __filename = fileURLToPath(import.meta.url) -const __dirname = dirname(__filename) +globalThis.__filename = fileURLToPath(import.meta.url) +globalThis.__dirname = dirname(__filename) // The built directory structure //