import { defineConfig } from "vite" import react from "@vitejs/plugin-react" import tailwindcss from "@tailwindcss/vite" import path from "node:path" export default defineConfig({ plugins: [react(), tailwindcss()], resolve: { alias: { "@": path.resolve(__dirname, "./src") }, }, server: { proxy: { // Dev: /api → FastAPI-Backend (Override via MC_API_TARGET, z.B. die Box) "/api": { target: process.env.MC_API_TARGET || "http://127.0.0.1:9000", changeOrigin: true }, // Box-Konsole (ttyd) läuft same-origin über den MC2-Reverse-Proxy (/console/ + /console/ws). "/console": { target: process.env.MC_API_TARGET || "http://127.0.0.1:9000", changeOrigin: true, ws: true }, }, }, build: { outDir: "dist" }, })