26 lines
534 B
TypeScript
26 lines
534 B
TypeScript
import react from "@vitejs/plugin-react";
|
|
import { defineConfig } from "vite";
|
|
|
|
const backendPort = Number(process.env.BACKEND_PORT ?? process.env.PORT ?? 3000);
|
|
|
|
export default defineConfig({
|
|
root: "src/web",
|
|
plugins: [react()],
|
|
server: {
|
|
host: "127.0.0.1",
|
|
port: 5173,
|
|
strictPort: true,
|
|
proxy: {
|
|
"/api": {
|
|
target: `http://127.0.0.1:${backendPort}`,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "../../dist/web",
|
|
emptyOutDir: true,
|
|
assetsDir: "assets",
|
|
},
|
|
});
|