26 lines
550 B
TypeScript
26 lines
550 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
// Both dev server and preview proxy /api to the backend service.
|
|
// `api` is the compose service name, identical in dev and prod.
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 3000,
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://api:8000",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
preview: {
|
|
port: 3000,
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://api:8000",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|