From af8aa6cf7c3bc65fa14ae53b0fa31094f0c9f5ea 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:53:28 +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 2d0d224..e5abc6d 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -3,8 +3,8 @@ import { release } from 'node:os' import { join, dirname } from 'node:path' import { fileURLToPath } from 'node:url' -const __filename = fileURLToPath(import.meta.url) -const __dirname = dirname(__filename) +globalThis.__filename = fileURLToPath(import.meta.url) +globalThis.__dirname = dirname(__filename) // The built directory structure //