Skip to content

Commit 9002810

Browse files
committed
Not use toPath in tsc when dealing with file watching
1 parent 988063e commit 9002810

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/compiler/tsc.ts

+2-4
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)