From 0f75dada1ee044d4db6c2049bfcf15a1bff91664 Mon Sep 17 00:00:00 2001 From: Psychotoxical <171614930+Psychotoxical@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:22:08 +0200 Subject: [PATCH] chore(tauri): enable devtools in dev builds only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes the explicit "devtools": false from tauri.conf.json so the Tauri default applies (true in debug, false in release). Auto-opens the inspector in the setup hook under #[cfg(debug_assertions)] so contributors get DevTools on `npm run tauri:dev` without right-clicking. `cargo check --release` confirms the open_devtools() call is hard-stripped from production binaries — the symbol does not exist in the release build. Helps debug WebView-side issues (CORS, TLS, axios responses) that the Rust-only logging mode does not capture. Co-Authored-By: Claude Opus 4.7 (1M context) --- src-tauri/src/lib.rs | 8 ++++++++ src-tauri/tauri.conf.json | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a6cc1202..1f586d83 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -3621,6 +3621,14 @@ pub fn run() { } } + #[cfg(debug_assertions)] + { + use tauri::Manager; + if let Some(win) = app.get_webview_window("main") { + win.open_devtools(); + } + } + // ── System tray ─────────────────────────────────────────────── // Always build on startup when possible; the frontend calls toggle_tray_icon(false) // immediately after load if the user has disabled the tray icon. diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9aa7653f..94dd3472 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -23,8 +23,7 @@ "decorations": true, "transparent": false, "visible": true, - "dragDropEnabled": false, - "devtools": false + "dragDropEnabled": false } ], "security": {