Skip to content

Commit 3acff6d

Browse files
committed
Merge pull request #7836 from zhengbli/fixFileCasingForTsc
Not use toPath in tsc when dealing with file watching
2 parents 65fdfd2 + 9002810 commit 3acff6d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/compiler/tsc.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ namespace ts {
333333
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
334334
}
335335
if (configFileName) {
336-
const configFilePath = toPath(configFileName, sys.getCurrentDirectory(), createGetCanonicalFileName(sys.useCaseSensitiveFileNames));
337-
configFileWatcher = sys.watchFile(configFilePath, configFileChanged);
336+
configFileWatcher = sys.watchFile(configFileName, configFileChanged);
338337
}
339338
if (sys.watchDirectory && configFileName) {
340339
const directory = ts.getDirectoryPath(configFileName);
@@ -446,8 +445,7 @@ namespace ts {
446445
const sourceFile = hostGetSourceFile(fileName, languageVersion, onError);
447446
if (sourceFile && isWatchSet(compilerOptions) && sys.watchFile) {
448447
// Attach a file watcher
449-
const filePath = toPath(sourceFile.fileName, sys.getCurrentDirectory(), createGetCanonicalFileName(sys.useCaseSensitiveFileNames));
450-
sourceFile.fileWatcher = sys.watchFile(filePath, (fileName: string, removed?: boolean) => sourceFileChanged(sourceFile, removed));
448+
sourceFile.fileWatcher = sys.watchFile(sourceFile.fileName, (fileName: string, removed?: boolean) => sourceFileChanged(sourceFile, removed));
451449
}
452450
return sourceFile;
453451
}

0 commit comments

Comments
 (0)