use process.env

This commit is contained in:
Alex Holliday
2025-06-25 12:17:16 +08:00
parent b718c02787
commit ba8011a22e
+2 -4
View File
@@ -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 {