@@ -459,7 +459,7 @@ function getLocalModuleSpecifier(moduleFileName: string, info: Info, compilerOpt
459
459
}
460
460
461
461
const baseDirectory = getNormalizedAbsolutePath ( getPathsBasePath ( compilerOptions , host ) || baseUrl ! , host . getCurrentDirectory ( ) ) ;
462
- const relativeToBaseUrl = getRelativePathIfInDirectory ( moduleFileName , baseDirectory , getCanonicalFileName ) ;
462
+ const relativeToBaseUrl = getRelativePathIfInSameVolume ( moduleFileName , baseDirectory , getCanonicalFileName ) ;
463
463
if ( ! relativeToBaseUrl ) {
464
464
return pathsOnly ? undefined : relativePath ;
465
465
}
@@ -773,7 +773,7 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl: string, paths: MapLike<rea
773
773
validateEnding ( { ending, value } )
774
774
) {
775
775
const matchedStar = value . substring ( prefix . length , value . length - suffix . length ) ;
776
- return key . replace ( "*" , matchedStar ) ;
776
+ return pathIsRelative ( matchedStar ) ? undefined : key . replace ( "*" , matchedStar ) ;
777
777
}
778
778
}
779
779
}
@@ -1038,7 +1038,7 @@ function tryGetAnyFileFromPath(host: ModuleSpecifierResolutionHost, path: string
1038
1038
1039
1039
function getPathsRelativeToRootDirs ( path : string , rootDirs : readonly string [ ] , getCanonicalFileName : GetCanonicalFileName ) : string [ ] | undefined {
1040
1040
return mapDefined ( rootDirs , rootDir => {
1041
- const relativePath = getRelativePathIfInDirectory ( path , rootDir , getCanonicalFileName ) ;
1041
+ const relativePath = getRelativePathIfInSameVolume ( path , rootDir , getCanonicalFileName ) ;
1042
1042
return relativePath !== undefined && isPathRelativeToParent ( relativePath ) ? undefined : relativePath ;
1043
1043
} ) ;
1044
1044
}
@@ -1133,7 +1133,7 @@ export function tryGetJSExtensionForFile(fileName: string, options: CompilerOpti
1133
1133
}
1134
1134
}
1135
1135
1136
- function getRelativePathIfInDirectory ( path : string , directoryPath : string , getCanonicalFileName : GetCanonicalFileName ) : string | undefined {
1136
+ function getRelativePathIfInSameVolume ( path : string , directoryPath : string , getCanonicalFileName : GetCanonicalFileName ) : string | undefined {
1137
1137
const relativePath = getRelativePathToDirectoryOrUrl ( directoryPath , path , directoryPath , getCanonicalFileName , /*isAbsolutePathAnUrl*/ false ) ;
1138
1138
return isRootedDiskPath ( relativePath ) ? undefined : relativePath ;
1139
1139
}
0 commit comments