mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
fix(ui): don't override env types
This commit is contained in:
@@ -261,21 +261,15 @@ export function ViewOptionsPopover({
|
||||
);
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface ImportMeta {
|
||||
env?: {
|
||||
BASE_URL?: unknown;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function withBasePath(href: string) {
|
||||
// ignore external
|
||||
if (href.match(/^\w+:/) || href.startsWith('//')) return href;
|
||||
|
||||
const basePath =
|
||||
// @ts-expect-error -- vite env
|
||||
typeof import.meta.env !== 'undefined' && typeof import.meta.env.BASE_URL === 'string'
|
||||
? import.meta.env.BASE_URL.replace(/\/$/, '')
|
||||
? // @ts-expect-error -- vite env
|
||||
import.meta.env.BASE_URL.replace(/\/$/, '')
|
||||
: '';
|
||||
return basePath + href;
|
||||
}
|
||||
|
||||
@@ -260,21 +260,15 @@ export function ViewOptionsPopover({
|
||||
);
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface ImportMeta {
|
||||
env?: {
|
||||
BASE_URL?: unknown;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function withBasePath(href: string) {
|
||||
// ignore external
|
||||
if (href.match(/^\w+:/) || href.startsWith('//')) return href;
|
||||
|
||||
const basePath =
|
||||
// @ts-expect-error -- vite env
|
||||
typeof import.meta.env !== 'undefined' && typeof import.meta.env.BASE_URL === 'string'
|
||||
? import.meta.env.BASE_URL.replace(/\/$/, '')
|
||||
? // @ts-expect-error -- vite env
|
||||
import.meta.env.BASE_URL.replace(/\/$/, '')
|
||||
: '';
|
||||
return basePath + href;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user