Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion apps/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,15 @@ function createWindow(port: number): void {
}
});

if (IS_DEV) {
// Auto-open DevTools only for real UI development (Vite HMR via
// dev:desktop) or when explicitly requested with HUABU_DEVTOOLS=1.
// Other unpacked runs (e.g. `start:desktop`, or an unpacked production
// build run straight from source) behave like production. F12 /
// Ctrl+Shift+I still toggle them at any time (see above).
if (
IS_DEV &&
(process.env.WEB_DEV_SERVER_URL || process.env.HUABU_DEVTOOLS === '1')
) {
mainWindow.webContents.openDevTools();
}

Expand Down