Skip to content

Commit e462dfa

Browse files
author
Orta Therox
authored
Don't use _fs.realpathSync.native on windows, a semi-revert of microsoft#41292 (microsoft#43348)
* Don't use _fs.realpathSync.native on windows, a semi-revert of microsoft#41292 * Use useCaseSensitiveFileNames instead
1 parent 34f0e32 commit e462dfa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/sys.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,6 @@ namespace ts {
11861186
let activeSession: import("inspector").Session | "stopping" | undefined;
11871187
let profilePath = "./profile.cpuprofile";
11881188

1189-
const realpathSync = _fs.realpathSync.native ?? _fs.realpathSync;
11901189

11911190
const Buffer: {
11921191
new (input: string, encoding?: string): any;
@@ -1199,6 +1198,8 @@ namespace ts {
11991198

12001199
const platform: string = _os.platform();
12011200
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
1201+
const realpathSync = useCaseSensitiveFileNames ? _fs.realpathSync : (_fs.realpathSync.native ?? _fs.realpathSync);
1202+
12021203
const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
12031204
const getCurrentDirectory = memoize(() => process.cwd());
12041205
const { watchFile, watchDirectory } = createSystemWatchFunctions({

0 commit comments

Comments
 (0)