25 lines
847 B
JavaScript
25 lines
847 B
JavaScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
// The web app talks ONLY to the API Server. In dev, /api is proxied to it so we
|
|
// avoid CORS and can use same-origin relative URLs in the client.
|
|
export default defineConfig({
|
|
plugins: [vue(), tailwindcss()],
|
|
server: {
|
|
port: 5173,
|
|
// Listen on all interfaces so the dev server is reachable on the LAN
|
|
// (e.g. http://10.2.1.101:5173 from another device).
|
|
host: true,
|
|
// Allow access via the LAN hostname/IP (Vite's host check otherwise blocks
|
|
// non-localhost Host headers). true = accept any host (fine for LAN dev).
|
|
allowedHosts: true,
|
|
proxy: {
|
|
"/api": {
|
|
target: process.env.VITE_API_TARGET || "http://localhost:8080",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|