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