1import path from "path";
2
3import tailwindcss from "@tailwindcss/vite";
4import react from "@vitejs/plugin-react";
5import { defineConfig } from "vite";
6
7// The Go backend URL. Run: git-bug webui --port 3000
8const API_URL = process.env.VITE_API_URL || "http://localhost:3000";
9
10export default defineConfig({
11 plugins: [tailwindcss(), react()],
12 resolve: {
13 alias: {
14 "@": path.resolve(__dirname, "./src"),
15 },
16 },
17 server: {
18 proxy: {
19 "/graphql": { target: API_URL, changeOrigin: true },
20 "/gitfile": { target: API_URL, changeOrigin: true },
21 "/upload": { target: API_URL, changeOrigin: true },
22 "/auth": { target: API_URL, changeOrigin: true },
23 },
24 },
25});