feat: dev proxy
This commit is contained in:
@ -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: "/",
|
||||
});
|
||||
}));
|
||||
|
Reference in New Issue
Block a user