diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 841dba8a528..052a50ab0a9 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -291,12 +291,11 @@ namespace ts { callback ); dirWatcher.on("error", () => { - if (!directoryExists(directoryName)) { - // Deleting directory - watcher = watchMissingDirectory(); - // Call the callback for current directory - callback("rename", ""); - } + // Watch the missing directory + watcher.close(); + watcher = watchMissingDirectory(); + // Call the callback for current directory + callback("rename", ""); }); return dirWatcher; }