File size: 431 Bytes
32e1e21
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
/**

 * Vite `base` is `/ui/` in production; static files from `web/public` live under that prefix.

 * Demo API routes stay at the site root (`/demo/...`), so do not use this for `/demo/*`.

 */
export function staticAssetUrl(path: string): string {
  const base = import.meta.env.BASE_URL;
  const b = base.endsWith("/") ? base : `${base}/`;
  const p = path.startsWith("/") ? path.slice(1) : path;
  return `${b}${p}`;
}