From 7a42eeb929c71d2a016f55f997dc2ad4a6ee9add Mon Sep 17 00:00:00 2001 From: Orta Date: Tue, 23 Mar 2021 16:43:34 +0000 Subject: [PATCH] Use useCaseSensitiveFileNames instead --- src/compiler/sys.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 0c612228de0e6..ef205bd02c8aa 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1186,7 +1186,8 @@ namespace ts { let activeSession: import("inspector").Session | "stopping" | undefined; let profilePath = "./profile.cpuprofile"; - const realpathSync = process.platform !== "win32" ? _fs.realpathSync.native : _fs.realpathSync; + const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); + const realpathSync = useCaseSensitiveFileNames ? _fs.realpathSync : (_fs.realpathSync.native ?? _fs.realpathSync); const Buffer: { new (input: string, encoding?: string): any; @@ -1198,7 +1199,6 @@ namespace ts { const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; const platform: string = _os.platform(); - const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); const getCurrentDirectory = memoize(() => process.cwd()); const { watchFile, watchDirectory } = createSystemWatchFunctions({