From eef348b8dcbf00ff949d378e6ec9ff238c24bf53 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Fri, 13 Jun 2025 03:11:35 +0800 Subject: [PATCH] fix: add conditional compilation for localhost URL in dev mode --- scripts/release-version.mjs | 1 - src-tauri/src/config/clash.rs | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/release-version.mjs b/scripts/release-version.mjs index d59eb764..0bff85ae 100644 --- a/scripts/release-version.mjs +++ b/scripts/release-version.mjs @@ -25,7 +25,6 @@ * Errors are logged and the process exits with code 1 on failure. */ - import fs from "fs/promises"; import path from "path"; import { program } from "commander"; diff --git a/src-tauri/src/config/clash.rs b/src-tauri/src/config/clash.rs index 5dbefdfd..2379b298 100644 --- a/src-tauri/src/config/clash.rs +++ b/src-tauri/src/config/clash.rs @@ -63,6 +63,8 @@ impl IClashTemp { vec![ "tauri://localhost", "http://tauri.localhost", + // Only enable this in dev mode + #[cfg(feature = "verge-dev")] "http://localhost:3000", "https://yacd.metacubex.one", "https://metacubex.github.io", @@ -103,6 +105,8 @@ impl IClashTemp { vec![ "tauri://localhost", "http://tauri.localhost", + // Only enable this in dev mode + #[cfg(feature = "verge-dev")] "http://localhost:3000", "https://yacd.metacubex.one", "https://metacubex.github.io",