import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; import { fileURLToPath, URL } from "node:url"; // The Go server reads build.manifest to find the hashed entry files, so the // manifest is not optional here — without it there is no document to render. export default defineConfig({ plugins: [react(), tailwindcss()], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) }, }, build: { manifest: true, outDir: "dist", emptyOutDir: true, }, server: { port: 5173, // In development Vite owns index.html and the API lives in the Go process. // The share tags are therefore only exercised by the container, which is // what the CI smoke test is for. proxy: { "/api": { target: "http://localhost:3000", changeOrigin: false }, // Regex, not a prefix: Vite only treats a key as one when it starts with ^. "^/kampanyok/.+/og\\.png$": { target: "http://localhost:3000" }, }, }, });