1import tailwindcss from "@tailwindcss/vite";
2import { tanstackRouter } from "@tanstack/router-plugin/vite";
3import react from "@vitejs/plugin-react";
4import { defineConfig } from "vite";
5import tsconfigPaths from "vite-tsconfig-paths";
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: [
12 tanstackRouter({ target: "react", autoCodeSplitting: true }),
13 tsconfigPaths(),
14 tailwindcss(),
15 react(),
16 ],
17 server: {
18 proxy: {
19 "/graphql": { target: API_URL, changeOrigin: true },
20 "/gitfile": { target: API_URL, changeOrigin: true },
21 "/gitraw": { target: API_URL, changeOrigin: true },
22 "/upload": { target: API_URL, changeOrigin: true },
23 "/auth": { target: API_URL, changeOrigin: true },
24 },
25 },
26});