chore: air hot-reload + configurable backend port for dev proxy
This commit is contained in:
+5
-1
@@ -2,12 +2,16 @@ import { defineConfig } from "vite";
|
||||
import preact from "@preact/preset-vite";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
|
||||
// Бэк для дев-прокси выбирается портом, не правкой кода:
|
||||
// BACKEND_PORT=8081 pnpm dev -> прокси на вторую (рабочую/дев) копию.
|
||||
const apiTarget = `http://localhost:${process.env.BACKEND_PORT ?? 8080}`;
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [preact(), tailwindcss()],
|
||||
server: {
|
||||
proxy: {
|
||||
// Connect RPC calls in dev go straight to the Go server.
|
||||
"/homelab.v1.HomelabService": "http://localhost:8080",
|
||||
"/homelab.v1.HomelabService": apiTarget,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user