mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 04:43:36 +00:00
Merge pull request #766 from ZacharyZcR/feat/runtime-base-path
feat: support runtime base path configuration via BASE_PATH env var
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user