Files
life-echo/app-eval-web/vite.config.ts

33 lines
856 B
TypeScript
Raw Normal View History

import react from "@vitejs/plugin-react";
import { loadEnv } from "vite";
import { defineConfig } from "vitest/config";
/**
* VITE_EVAL_API_BASE /internal/... Vite
* api/development.sh INTERNAL_EVAL_PORT 7999
* VITE_EVAL_PROXY_TARGET=http://127.0.0.1:8001 npm run dev
*/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const proxyTarget =
(env.VITE_EVAL_PROXY_TARGET || "").trim() ||
"http://127.0.0.1:7999";
return {
plugins: [react()],
server: {
port: 5174,
proxy: {
"/internal": {
target: proxyTarget,
changeOrigin: true,
},
},
},
test: {
environment: "node",
include: ["src/**/*.test.ts"],
},
};
});