feat: dev proxy

This commit is contained in:
2025-05-21 19:26:26 +02:00
parent 4a71f6c5ee
commit e9e1414c90

View File

@ -4,8 +4,20 @@ import tailwindcss from "@tailwindcss/vite";
import { resolve } from "path";
// https://vite.dev/config/
export default defineConfig({
export default defineConfig(({ mode }) => ({
plugins: [react(), tailwindcss()],
server:
mode === "development"
? {
proxy: {
"/api": {
target: "http://127.0.0.1:3001",
changeOrigin: true,
secure: false,
},
},
}
: undefined,
build: {
outDir: "../dist",
emptyOutDir: true,
@ -16,4 +28,4 @@ export default defineConfig({
},
},
base: "/",
});
}));