mirror of https://github.com/vuejs/core.git
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:
parent
5fab826ea2
commit
5246bdfe53
|
@ -1031,7 +1031,9 @@ function resolveWithTS(
|
||||||
} else {
|
} else {
|
||||||
const [major, minor] = ts.versionMajorMinor.split('.').map(Number)
|
const [major, minor] = ts.versionMajorMinor.split('.').map(Number)
|
||||||
function getPattern(base: string, p: string): string {
|
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
|
? // ts 5.5+ supports ${configDir} in paths
|
||||||
normalizePath(p.replace('${configDir}', dirname(configPath!)))
|
normalizePath(p.replace('${configDir}', dirname(configPath!)))
|
||||||
: joinPaths(base, p)
|
: joinPaths(base, p)
|
||||||
|
|
Loading…
Reference in New Issue