import { fileURLToPath, URL } from "node:url"; import { defineConfig } from "vite"; import tailwindcss from "@tailwindcss/vite"; import vue from "@vitejs/plugin-vue"; // The app is served under /usaco/ (BASE_PATH on the server), so every asset // URL and the router's history base carry it. Changing one means changing both. // // `npm run dev` proxies the API to the Go server: VITE_PROXY_USACO (default // localhost:8080, the standalone docker-compose). export default defineConfig({ base: "/usaco/", plugins: [vue(), tailwindcss()], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, server: { host: "0.0.0.0", proxy: { "/usaco/api": process.env.VITE_PROXY_USACO || "http://localhost:8080", }, }, });