23 lines
551 B
TypeScript
23 lines
551 B
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
const proxyTarget = env.VITE_PROXY_TARGET || "http://localhost:8081";
|
|
|
|
return {
|
|
plugins: [react(), tailwindcss()],
|
|
server: {
|
|
proxy: {
|
|
"/api": {
|
|
target: proxyTarget,
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ""),
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|
|
|