import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import tailwindcss from "@tailwindcss/vite"; const apiTarget = process.env.ARCHIE_DEV_API ?? "http://127.0.0.1:8484"; export default defineConfig({ plugins: [vue(), tailwindcss()], resolve: { alias: { "@": new URL("./src", import.meta.url).pathname, }, }, base: "/", build: { outDir: "dist", emptyOutDir: true, }, server: { // Proxies the API to a locally running archie binary (or legacy archie-ui // when ARCHIE_DEV_API is set) so the frontend can be developed without // rebuilding Go. changeOrigin stays false so Origin matches Host on // mutations. proxy: { "/api": { target: apiTarget, changeOrigin: false }, "/healthz": { target: apiTarget, changeOrigin: false }, "/readyz": { target: apiTarget, changeOrigin: false }, "/health": { target: apiTarget, changeOrigin: false }, "/webhooks": { target: apiTarget, changeOrigin: false }, }, }, });