Skip to content

Commit 6d55769

Browse files
committed
Fixed believed issue with watch implementation cc @sheetalkamat
1 parent 4a6b0da commit 6d55769

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/index.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,16 @@ function updateFileInCache(filePath: string, contents: string, instance: TSInsta
178178
instance.files[filePath] = file;
179179
}
180180
else {
181-
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created;
181+
if (instance.watchHost) {
182+
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created;
183+
}
182184
file = instance.files[filePath] = <TSFile>{ version: 0 };
183185
}
184186
instance.changedFilesList = true;
185187
}
186188

187-
if (contents === undefined) {
188-
fileWatcherEventKind === instance.compiler.FileWatcherEventKind.Deleted;
189+
if (instance.watchHost && contents === undefined) {
190+
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Deleted;
189191
}
190192

191193
if (file.text !== contents) {

0 commit comments

Comments
 (0)