From 6d55769318841d1d51e74ccf5882c421c2a7a2bb Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 20 Jan 2018 21:51:56 +0000 Subject: [PATCH] Fixed believed issue with watch implementation cc @sheetalkamat --- src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4d4d82ee1..f81422502 100644 --- a/src/index.ts +++ b/src/index.ts @@ -178,14 +178,16 @@ function updateFileInCache(filePath: string, contents: string, instance: TSInsta instance.files[filePath] = file; } else { - fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created; + if (instance.watchHost) { + fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created; + } file = instance.files[filePath] = { version: 0 }; } instance.changedFilesList = true; } - if (contents === undefined) { - fileWatcherEventKind === instance.compiler.FileWatcherEventKind.Deleted; + if (instance.watchHost && contents === undefined) { + fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Deleted; } if (file.text !== contents) {