23 lines
469 B
TypeScript
23 lines
469 B
TypeScript
|
|
import { defineConfig, loadEnv } from "vite";
|
||
|
|
import preact from "@preact/preset-vite";
|
||
|
|
|
||
|
|
export default defineConfig(({ mode }) => {
|
||
|
|
const env = loadEnv(mode, process.cwd(), "");
|
||
|
|
const backendUrl = env.VITE_BACKEND_URL || "http://localhost:8000";
|
||
|
|
|
||
|
|
return {
|
||
|
|
plugins: [preact()],
|
||
|
|
server: {
|
||
|
|
proxy: {
|
||
|
|
"/api": backendUrl,
|
||
|
|
"/health": backendUrl,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
build: {
|
||
|
|
outDir: "dist",
|
||
|
|
emptyOutDir: true,
|
||
|
|
},
|
||
|
|
};
|
||
|
|
});
|
||
|
|
|