gitevents / core

GitEvents core; manage your user group with GitHub
MIT License
41 stars 19 forks source link

Nodemon: Only watch files we care about #131

Closed mike182uk closed 8 years ago

mike182uk commented 8 years ago

Currently when running npm run dev any file that is changed in the project triggers nodemon to restart the service. This seems unnecessary, we could probably scope this to just lib & common as these are the files we care about watching and reloading the service when they change.

Thoughts?

PatrickHeneise commented 8 years ago

there's nodemonignore, but imho it doesn't really matter, files beside lib/common don't usually change and nodemon is really fast reloading the core.

mike182uk commented 8 years ago

My IDE is creating a directory in the project that it uses to save state. Every time this changes nodemon reloads. The IDE saves to this directory a lot causing loads of reloads which can make debugging stuff difficult (reloads half way through me trying to watch a request come in etc). To fix this i could

  1. use a different IDE - I shouldn't have to do this to work on the project
  2. add IDE state directory to the ignore list in the nodemon.json - We do not want to have to do this for every single IDE
  3. have a local .nodemonignore that i do not commit to the project - This is the most reasonable solution, but could be accidentally committed / requires setting up every time i fork the repo.

As you have said files beside lib/common don't usually change, so why watch them in the first place?

PatrickHeneise commented 8 years ago

Alright, that makes sense in this case. Just watch the main .js files (in case of debugging or whatever, I do want the app to reload on all .js and .json changes).