This repository has been archived on 2026-10-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
maestro/web/vite.config.ts
T
Miguel Palhas c856333e4a
ci / rust (push) Successful in 2m40s
docs(maestro): describe the single-host architecture
Rewrites CLAUDE.md as the current-architecture reference, drops the
registry from INSTALL/PRODUCT/DESIGN and the web README, deletes the
registry Dockerfile, and marks the dated design specs superseded where
they describe the registry, JWT auth, or cross-host attach.

The installer loses its configure step — every config field now has a
default, so a daemon starts with no config file at all.
2026-08-22 10:26:49 +01:00

40 lines
1.0 KiB
TypeScript

import { defineConfig, loadEnv } from "vite";
// Where the dev proxy forwards `/api/*` (and the events WS) to. Default to a
// local daemon on 127.0.0.1:7070. Override with:
// MAESTRO_DAEMON_URL=http://laptop.lan:7070
// `ws://`/`wss://` forms are normalised to http/https, since the proxy needs an
// HTTP base URL.
function resolveProxyTarget(raw: string | undefined): string {
if (!raw) return "http://127.0.0.1:7070";
return raw
.replace(/^wss:\/\//, "https://")
.replace(/^ws:\/\//, "http://")
.replace(/\/+$/, "");
}
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const target = resolveProxyTarget(env.MAESTRO_DAEMON_URL);
const secure = target.startsWith("https://");
return {
build: {
target: "es2022",
outDir: "dist",
emptyOutDir: true,
sourcemap: false,
},
server: {
port: 5173,
proxy: {
"/api": {
target,
changeOrigin: secure,
ws: true,
secure: false,
},
},
},
};
});