docs: fix cross-project links to use base path in production (#8160)
This commit is contained in:
@@ -18,7 +18,7 @@ const PROJECT_REGEX = /^!(?<area>[\w-]+)!/
|
||||
|
||||
function matchAndFixLinks(
|
||||
link: string,
|
||||
{ baseUrl, projectUrls }: CrossProjectLinksOptions
|
||||
{ baseUrl, projectUrls, useBaseUrl = false }: CrossProjectLinksOptions
|
||||
): string {
|
||||
const projectArea = PROJECT_REGEX.exec(link)
|
||||
|
||||
@@ -29,6 +29,7 @@ function matchAndFixLinks(
|
||||
const actualUrl = link.replace(PROJECT_REGEX, "")
|
||||
|
||||
const base =
|
||||
!useBaseUrl &&
|
||||
projectUrls &&
|
||||
Object.hasOwn(projectUrls, projectArea.groups.area) &&
|
||||
projectUrls[projectArea.groups.area]?.url
|
||||
|
||||
@@ -115,6 +115,7 @@ export declare type CrossProjectLinksOptions = {
|
||||
path?: string
|
||||
}
|
||||
}
|
||||
useBaseUrl?: boolean
|
||||
}
|
||||
|
||||
export declare type TypeListLinkFixerOptions = {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"lib": ["es2022"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"target": "ESNext",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"esModuleInterop": true,
|
||||
|
||||
Reference in New Issue
Block a user