diff --git a/src/client/theme-default/components/VPButton.vue b/src/client/theme-default/components/VPButton.vue
index 0f818d9a34d..714f3e0cb21 100644
--- a/src/client/theme-default/components/VPButton.vue
+++ b/src/client/theme-default/components/VPButton.vue
@@ -1,6 +1,7 @@
diff --git a/src/client/theme-default/support/utils.ts b/src/client/theme-default/support/utils.ts
index be2a39c8749..5c31e6f0ecd 100644
--- a/src/client/theme-default/support/utils.ts
+++ b/src/client/theme-default/support/utils.ts
@@ -1,15 +1,15 @@
import { ref } from 'vue'
import { withBase } from 'vitepress'
+import { EXTERNAL_URL_RE } from '../../shared'
export const HASH_RE = /#.*$/
export const EXT_RE = /(index)?\.(md|html)$/
-export const OUTBOUND_RE = /^[a-z]+:/i
const inBrowser = typeof window !== 'undefined'
const hashRef = ref(inBrowser ? location.hash : '')
export function isExternal(path: string): boolean {
- return OUTBOUND_RE.test(path)
+ return EXTERNAL_URL_RE.test(path)
}
export function throttleAndDebounce(fn: () => void, delay: number): () => void {
diff --git a/src/shared/shared.ts b/src/shared/shared.ts
index 7db6114e07a..959d470c920 100644
--- a/src/shared/shared.ts
+++ b/src/shared/shared.ts
@@ -10,7 +10,7 @@ export type {
PageDataPayload
} from '../../types/shared'
-export const EXTERNAL_URL_RE = /^https?:/i
+export const EXTERNAL_URL_RE = /^[a-z]+:/i
export const APPEARANCE_KEY = 'vitepress-theme-appearance'
// @ts-ignore
diff --git a/src/shared/tsconfig.json b/src/shared/tsconfig.json
index 72027ca40e3..7a50c0689fc 100644
--- a/src/shared/tsconfig.json
+++ b/src/shared/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../tsconfig.json",
+ "extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"lib": ["ESNext", "DOM"]