Files
tranquil-pds/frontend/vite.config.ts
2026-05-19 19:46:58 +03:00

33 lines
802 B
TypeScript

import process from "node:process";
import { defineConfig, loadEnv } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const target = env.VITE_API_URL || "http://localhost:3000";
return {
plugins: [svelte()],
build: {
outDir: "dist",
},
server: {
port: 5173,
proxy: {
"/xrpc": target,
"/oauth": target,
"/.well-known": target,
"/health": target,
"/u": target,
},
hmr: env.VITE_HMR_HOST
? {
protocol: env.VITE_HMR_PROTOCOL || "wss",
host: env.VITE_HMR_HOST,
clientPort: parseInt(env.VITE_HMR_PORT || "443"),
}
: undefined,
},
};
});