mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 21:03:47 +00:00
11 lines
396 B
TypeScript
11 lines
396 B
TypeScript
export function getBasePath(): string {
|
|
const runtime = (window as unknown as Record<string, unknown>)
|
|
.__TERMIX_BASE_PATH__ as string | undefined;
|
|
if (runtime) {
|
|
return runtime.endsWith("/") ? runtime.slice(0, -1) : runtime;
|
|
}
|
|
const base = import.meta.env.BASE_URL || "/";
|
|
if (base === "./" || base === "/") return "";
|
|
return base.endsWith("/") ? base.slice(0, -1) : base;
|
|
}
|