mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Merge pull request #6066 from zhengbli/i6016_for17
Roll back to polling file watching for 1.7
This commit is contained in:
@@ -411,11 +411,6 @@ namespace ts {
|
||||
// and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649
|
||||
// and https://github.com/Microsoft/TypeScript/issues/4643), therefore
|
||||
// if the current node.js version is newer than 4, use `fs.watch` instead.
|
||||
if (isNode4OrLater()) {
|
||||
// Note: in node the callback of fs.watch is given only the relative file name as a parameter
|
||||
return _fs.watch(fileName, (eventName: string, relativeFileName: string) => callback(fileName));
|
||||
}
|
||||
|
||||
const watchedFile = watchedFileSet.addFile(fileName, callback);
|
||||
return {
|
||||
close: () => watchedFileSet.removeFile(watchedFile)
|
||||
|
||||
Reference in New Issue
Block a user