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 /jobs/ (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_JOBS is the // tracker (default localhost:8080, the standalone docker-compose), and // VITE_PROXY_SITE is the main site's backend, which the site's login and // refresh routes under /api live on — only needed when the tracker runs with // AUTH_MODE=forward. export default defineConfig({ base: "/jobs/", plugins: [vue(), tailwindcss()], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, server: { host: "0.0.0.0", proxy: { "/jobs/api": process.env.VITE_PROXY_JOBS || "http://localhost:8080", "/api": process.env.VITE_PROXY_SITE || "http://localhost:8081", }, }, });