@@ -1032,7 +1032,7 @@ function isExternalProjectReference(
1032
1032
workspaceRoot : string ,
1033
1033
projectRoot : string
1034
1034
) : boolean {
1035
- const relativePath = posix . relative ( workspaceRoot , refTsConfigPath ) ;
1035
+ const relativePath = posixRelative ( workspaceRoot , refTsConfigPath ) ;
1036
1036
if ( cache . isExternalProjectReference [ relativePath ] !== undefined ) {
1037
1037
return cache . isExternalProjectReference [ relativePath ] ;
1038
1038
}
@@ -1074,7 +1074,7 @@ function retrieveTsConfigFromCache(
1074
1074
tsConfigPath : string ,
1075
1075
workspaceRoot : string
1076
1076
) : ParsedTsconfigData {
1077
- const relativePath = posix . relative ( workspaceRoot , tsConfigPath ) ;
1077
+ const relativePath = posixRelative ( workspaceRoot , tsConfigPath ) ;
1078
1078
1079
1079
// we don't need to check the hash if it's in the cache, because we've already
1080
1080
// checked it when we initially populated the cache
@@ -1103,7 +1103,7 @@ function readTsConfigAndCache(
1103
1103
tsConfigPath : string ,
1104
1104
workspaceRoot : string
1105
1105
) : ParsedTsconfigData {
1106
- const relativePath = posix . relative ( workspaceRoot , tsConfigPath ) ;
1106
+ const relativePath = posixRelative ( workspaceRoot , tsConfigPath ) ;
1107
1107
const hash = getFileHash ( tsConfigPath , workspaceRoot ) ;
1108
1108
1109
1109
let extendedFilesHash : string ;
@@ -1261,7 +1261,7 @@ function resolveExtendedTsConfigPath(
1261
1261
}
1262
1262
1263
1263
function getFileHash ( filePath : string , workspaceRoot : string ) : string {
1264
- const relativePath = posix . relative ( workspaceRoot , filePath ) ;
1264
+ const relativePath = posixRelative ( workspaceRoot , filePath ) ;
1265
1265
if ( ! cache . fileHashes [ relativePath ] ) {
1266
1266
const content = readFile ( filePath , workspaceRoot ) ;
1267
1267
cache . fileHashes [ relativePath ] = hashArray ( [ content ] ) ;
@@ -1271,7 +1271,7 @@ function getFileHash(filePath: string, workspaceRoot: string): string {
1271
1271
}
1272
1272
1273
1273
function readFile ( filePath : string , workspaceRoot : string ) : string {
1274
- const relativePath = posix . relative ( workspaceRoot , filePath ) ;
1274
+ const relativePath = posixRelative ( workspaceRoot , filePath ) ;
1275
1275
if ( ! cache . rawFiles [ relativePath ] ) {
1276
1276
const content = readFileSync ( filePath , 'utf8' ) ;
1277
1277
cache . rawFiles [ relativePath ] = content ;
@@ -1353,41 +1353,48 @@ function toRelativePaths(
1353
1353
hash,
1354
1354
} ;
1355
1355
if ( data . options . rootDir ) {
1356
- updatedCache [ key ] . data . options . rootDir = posix . relative (
1356
+ updatedCache [ key ] . data . options . rootDir = posixRelative (
1357
1357
workspaceRoot ,
1358
1358
data . options . rootDir
1359
1359
) ;
1360
1360
}
1361
1361
if ( data . options . outDir ) {
1362
- updatedCache [ key ] . data . options . outDir = posix . relative (
1362
+ updatedCache [ key ] . data . options . outDir = posixRelative (
1363
1363
workspaceRoot ,
1364
1364
data . options . outDir
1365
1365
) ;
1366
1366
}
1367
1367
if ( data . options . outFile ) {
1368
- updatedCache [ key ] . data . options . outFile = posix . relative (
1368
+ updatedCache [ key ] . data . options . outFile = posixRelative (
1369
1369
workspaceRoot ,
1370
1370
data . options . outFile
1371
1371
) ;
1372
1372
}
1373
1373
if ( data . options . tsBuildInfoFile ) {
1374
- updatedCache [ key ] . data . options . tsBuildInfoFile = posix . relative (
1374
+ updatedCache [ key ] . data . options . tsBuildInfoFile = posixRelative (
1375
1375
workspaceRoot ,
1376
1376
data . options . tsBuildInfoFile
1377
1377
) ;
1378
1378
}
1379
1379
if ( data . extendedConfigFile ?. filePath ) {
1380
- updatedCache [ key ] . data . extendedConfigFile . filePath = posix . relative (
1380
+ updatedCache [ key ] . data . extendedConfigFile . filePath = posixRelative (
1381
1381
workspaceRoot ,
1382
1382
data . extendedConfigFile . filePath
1383
1383
) ;
1384
1384
}
1385
1385
if ( data . projectReferences ) {
1386
1386
updatedCache [ key ] . data . projectReferences = data . projectReferences . map (
1387
- ( ref ) => ( { ...ref , path : posix . relative ( workspaceRoot , ref . path ) } )
1387
+ ( ref ) => ( {
1388
+ ...ref ,
1389
+ path : posixRelative ( workspaceRoot , ref . path ) ,
1390
+ } )
1388
1391
) ;
1389
1392
}
1390
1393
}
1391
1394
1392
1395
return updatedCache ;
1393
1396
}
1397
+
1398
+ function posixRelative ( workspaceRoot : string , path : string ) : string {
1399
+ return posix . normalize ( relative ( workspaceRoot , path ) ) ;
1400
+ }
0 commit comments