27 lines
580 B
TypeScript
27 lines
580 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
export default defineConfig(() => {
|
|
const apiTarget = process.env.VITE_DEV_API_PROXY_TARGET ?? "http://localhost:4000";
|
|
return {
|
|
plugins: [react()],
|
|
publicDir: "../../public",
|
|
resolve: {
|
|
dedupe: ["react", "react-dom"],
|
|
},
|
|
server: {
|
|
port: 5601,
|
|
proxy: {
|
|
"/api": {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
},
|
|
"/uploads": {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|