I use entr for all my file-watching needs, if I need a roll-my-own solution. This article is a good introduction to the main ways to use it.
If you use Vim, however, its defaults can interfere with auto-build setups that depend on file watching: https://lee-phillips.org/badvim/