Skip to content

Commit 8e80a7d

Browse files
fix(ServerHost): do not add file & dir watchers
1 parent ff38901 commit 8e80a7d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

projects/igniteui-angular/migrations/common/ServerHost.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,24 @@ export class ServerHost implements ts.server.ServerHost {
3838
return ts.sys.getFileSize(path);
3939
}
4040

41-
public watchFile(path: string, callback: ts.FileWatcherCallback, pollingInterval?: number):
41+
//#region Watchers
42+
// Atm we do not need to have file or dir watchers that access the actual FS
43+
// as we are only working with NG's virtual FS
44+
// Prior to https://github.com/microsoft/TypeScript/pull/49990 we were more or less required
45+
// to add a watcher since it threw an error otherwise
46+
47+
public watchFile(_path: string, _callback: ts.FileWatcherCallback, _pollingInterval?: number):
4248
ts.FileWatcher {
43-
return ts.sys.watchFile(path, callback, pollingInterval);
49+
// return ts.sys.watchFile(path, callback, pollingInterval);
50+
return undefined;
4451
}
4552

46-
public watchDirectory(path: string, callback: ts.DirectoryWatcherCallback, recursive?: boolean):
53+
public watchDirectory(_path: string, _callback: ts.DirectoryWatcherCallback, _recursive?: boolean):
4754
ts.FileWatcher {
48-
return ts.sys.watchDirectory(path, callback, recursive);
55+
// return ts.sys.watchDirectory(path, callback, recursive);
56+
return undefined;
4957
}
58+
//#endregion
5059

5160
public resolvePath(path: string): string {
5261
return ts.sys.resolvePath(path);

0 commit comments

Comments
 (0)