From ba8011a22ec60fafe91e67fb252f34c7e0c9f45f Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 25 Jun 2025 12:17:16 +0800 Subject: [PATCH] use process.env --- client/vite.config.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/vite.config.js b/client/vite.config.js index e930a20e9..20943eeb4 100644 --- a/client/vite.config.js +++ b/client/vite.config.js @@ -4,10 +4,8 @@ import svgr from "vite-plugin-svgr"; import { execSync } from "child_process"; export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd(), ""); - let version = env.VITE_APP_VERSION; - - if (!version) { + let version = process.env.VITE_APP_VERSION; + if (!version || version === "unknown") { try { version = execSync("git describe --tags --abbrev=0").toString().trim(); } catch {