Skip to content

Commit 48b85d1

Browse files
committed
fix: correct usage of import.meta.dirname in catchException and appConfig
1 parent 4513d5c commit 48b85d1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apps/electron/src/catchException.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { app, dialog } from 'electron'
22

3+
globalThis.__dirname ||= import.meta.dirname
4+
35
// Expose the dev build version when running unpackaged so logs stay accurate.
46
if (!app.isPackaged) {
57
app.getVersion = () => import.meta.env.VITE_APP_VERSION

apps/electron/src/constants/appConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { join } from 'node:path'
21
import { app } from 'electron'
2+
import { join } from 'node:path'
33
import { isPackaged } from './common'
44

55
const sessionDir = app.getPath('sessionData')
@@ -23,7 +23,7 @@ export const appConfig = {
2323
get webBaseURL() {
2424
return !isPackaged && import.meta.env.VITE_DEV_SERVER_URL !== undefined
2525
? import.meta.env.VITE_DEV_SERVER_URL
26-
: `file://${join(__dirname, './web/index.html')}`
26+
: `file://${join(import.meta.dirname, './web/index.html')}`
2727
},
2828
} as const
2929

0 commit comments

Comments
 (0)