Configure FIR production API defaults and environment overrides
Deploy B9 / deploy (push) Successful in 4m13s

This commit is contained in:
fucheng
2026-11-02 11:47:39 +08:00
parent 650e8ef017
commit 6d952fa0fd
7 changed files with 29 additions and 10 deletions
+7 -3
View File
@@ -4,7 +4,7 @@ import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import fs from "node:fs";
import path from "node:path";
import { defineConfig, type Plugin } from "vite";
import { defineConfig, loadEnv, type Plugin } from "vite";
import { vitePluginManusRuntime } from "vite-plugin-manus-runtime";
const PROJECT_ROOT = import.meta.dirname;
@@ -59,7 +59,10 @@ const deployBase = isProd
? (DEPLOY_ENV === "test" ? `/${DEPLOY_PROJECT}/test/modern/` : `/${DEPLOY_PROJECT}/v2/modern/`)
: "/";
export default defineConfig({
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, PROJECT_ROOT, "");
return {
plugins,
base: deployBase,
resolve: {
@@ -138,7 +141,7 @@ export default defineConfig({
timeout: 0,
proxyTimeout: 0,
},
"/fir-library": { target: "http://127.0.0.1:8000", changeOrigin: true, rewrite: p => p.replace(/^\/fir-library/, "/api") },
"/fir-library": { target: env.FIR_LIBRARY_PROXY_TARGET || "https://cs-fir.luxsin.com.cn", changeOrigin: true, rewrite: p => p.replace(/^\/fir-library/, "/api") },
"/luxsin-audio-api": {
target: "https://api.luxsin.com.cn",
changeOrigin: true,
@@ -159,4 +162,5 @@ export default defineConfig({
deny: ["**/.*"],
},
},
};
});