mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-05 16:14:09 +00:00
- Add media-src 'self' blob: to CSP for TTS audio blob URLs - Show advanced config section expanded by default - Add Save button in credentials section - Show Voice/Playground sections only after credentials saved - Improve voice picker message when API key not saved yet - Add Vite proxy timeout for large audio responses
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import path from "path";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
const backendPort = env.VITE_BACKEND_PORT || "9600";
|
|
const backendHost = env.VITE_BACKEND_HOST || "localhost";
|
|
|
|
return {
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
"/ws": {
|
|
target: `http://${backendHost}:${backendPort}`,
|
|
ws: true,
|
|
changeOrigin: true,
|
|
},
|
|
"/v1": {
|
|
target: `http://${backendHost}:${backendPort}`,
|
|
changeOrigin: true,
|
|
timeout: 30000, // 30s for large audio responses
|
|
},
|
|
"/health": {
|
|
target: `http://${backendHost}:${backendPort}`,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
},
|
|
};
|
|
});
|