feat: added vite_main_bundle_id config and improved code cleanliness

This commit is contained in:
kangfenmao
2024-09-15 10:35:02 +08:00
parent a654ccc25e
commit 01acdeb777
4 changed files with 25 additions and 6 deletions
+9
View File
@@ -0,0 +1,9 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
VITE_MAIN_BUNDLE_ID: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}
+1 -1
View File
@@ -12,7 +12,7 @@ app.whenReady().then(async () => {
await updateUserDataPath()
// Set app user model id for windows
electronApp.setAppUserModelId('com.kangfenmao.CherryStudio')
electronApp.setAppUserModelId(import.meta.env.VITE_MAIN_BUNDLE_ID || 'com.kangfenmao.CherryStudio')
// Default open or close DevTools by F12 in development
// and ignore CommandOrControl + R in production.