29 lines
730 B
TypeScript
29 lines
730 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
// Cyrene v2 frontend (M9). Dev server proxies REST + WebSocket to the single
|
|
// backend gateway on :8080 so the SPA can stay same-origin. The production
|
|
// build is served by the gateway itself (single binary), so `base` is relative
|
|
// and there is no runtime proxy.
|
|
const devProxy = {
|
|
"/api": { target: "http://localhost:8080", changeOrigin: true },
|
|
"/ws": { target: "ws://localhost:8080", ws: true },
|
|
};
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
base: "./",
|
|
server: {
|
|
port: 5173,
|
|
proxy: devProxy,
|
|
},
|
|
preview: {
|
|
port: 4173,
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
sourcemap: false,
|
|
target: "es2022",
|
|
},
|
|
});
|