This commit is contained in:
2026-07-12 21:26:08 +08:00
commit 9dd41afd48
502 changed files with 129901 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { resolve } from "node:path";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
const apiOrigin = process.env.LLM_WIKI_AGENT_API_ORIGIN || "http://localhost:8787";
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
"@": resolve(import.meta.dirname, "./src"),
},
},
server: {
// 用 5180 避开 Vite 默认 5173(其他项目可能占用);strictPort 让冲突时直接报错,避免静默漂移
host: "0.0.0.0",
port: 5180,
strictPort: true,
proxy: {
// dev 期同源访问后端,避免 CORS;生产由后端/Tauri 直接服务前端
"/api": {
target: apiOrigin,
changeOrigin: true,
},
},
},
});