linux and we could exhaust it pretty quickly with programs that include large number of files. Also there could be limit on number of watches that can be created, e.g. But this is OS dependent and the notification is not completely reliable and does not work as expected on many OS.
The -watch implementation of the compiler relies on using fs.watch and fs.watchFile which are provided by node, both of these methods have pros and cons.įs.watch uses file system events to notify the changes in the file/directory. Compiler supports configuring how to watch files and directories using compiler flags in TypeScript 3.8+, and environment variables before that.