22 lines
523 B
TypeScript
22 lines
523 B
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
// Dev: /api → localhost:51291 (как nginx в Docker)
|
|
const apiProxyTarget = env.VITE_API_PROXY_TARGET || "http://localhost:51291";
|
|
|
|
return {
|
|
plugins: [react()],
|
|
server: {
|
|
port: 51290,
|
|
proxy: {
|
|
"/api": {
|
|
target: apiProxyTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|