// config/paths.js let __configCache; export async function getBaseUrl() { if (__configCache) return __configCache; const res = await fetch("/config.json"); if (!res.ok) throw new Error("config.json konnte nicht geladen werden"); const config = await res.json(); const basePath = (config.basePath || "").replace(/^\/|\/$/g, ""); __configCache = basePath ? `/${basePath}` : ""; return __configCache; }