Update packages/compiler-sfc/src/script/resolveType.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
edison 2025-06-18 14:46:26 +08:00 committed by GitHub
parent 5fab826ea2
commit 5246bdfe53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1031,7 +1031,9 @@ function resolveWithTS(
} else {
const [major, minor] = ts.versionMajorMinor.split('.').map(Number)
function getPattern(base: string, p: string): string {
return p.startsWith('${configDir}') && major >= 5 && minor >= 5
const supportsConfigDir =
major > 5 || (major === 5 && minor >= 5)
return p.startsWith('${configDir}') && supportsConfigDir
? // ts 5.5+ supports ${configDir} in paths
normalizePath(p.replace('${configDir}', dirname(configPath!)))
: joinPaths(base, p)