20 lines
595 B
TypeScript
20 lines
595 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
// In development the UI runs on :5173 and the API on :8000, so /api is proxied.
|
|
// In production both are served from the same origin (the backend serves the
|
|
// built files), which is why every request in the app is a relative path.
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
"/api": {
|
|
target: process.env.VITE_API_TARGET || "http://localhost:8000",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: { outDir: "dist", sourcemap: false },
|
|
});
|