Skip to content

Commit 92a73e2

Browse files
authored
Merge in watch fixes
1 parent 27469c2 commit 92a73e2

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
@@ -179,14 +179,16 @@ function updateFileInCache(filePath: string, contents: string, instance: TSInsta
179179
instance.files[filePath] = file;
180180
}
181181
else {
182-
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created;
182+
if (instance.watchHost) {
183+
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created;
184+
}
183185
file = instance.files[filePath] = <TSFile>{ version: 0 };
184186
}
185187
instance.changedFilesList = true;
186188
}
187189

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

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

0 commit comments

Comments
 (0)