mirror of
https://tangled.org/tranquil.farm/tranquil-pds
synced 2026-05-28 10:50:21 +00:00
33 lines
802 B
TypeScript
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,
|
|
},
|
|
};
|
|
});
|