nodemon: Nodemon does not reload on --watch folder only on the app file
nodemon -v: 1.18.10node -v: 10.8.0- Operating system/terminal environment: MacOS, bash command
- Using Docker? What image: No
- Command you ran:
nodemon --watch ./build/dist --watch ./build/dist/graphql/schemas build/dist/index.js -V
Expected behavior
To have NodeJS restart.
Actual behavior
It detects the folder has a file that has changed but does not restart.
Steps to reproduce
- NPM script:
"watchgraphql": "cpx 'src/graphql/schemas/**/*.graphql' build/dist/graphql/schemas/ -w -v",
"dev": "concurrently \"tsc -w\" \"npm run watchgraphql\" \"nodemon --watch ./build/dist --watch ./build/dist/graphql/schemas build/dist/index.js -V\"",
- Run the script
npm run dev
This check for TypeScript file, when something is saved, transpile and save the JS. This change the index.js thus node is restarting as expected. However, if I change a .graphql file, the watchgraphql copy the file (as expected) and nodemon detect the change (see the verbose output) but node does not restart.
Verbose output:
[1] Copied: src/graphql/schemas/ocadmin/org.graphql --> build/dist/graphql/schemas/ocadmin/org.graphql [2] [nodemon] files triggering change check: build/dist/graphql/schemas/ocadmin/org.graphql [2] [nodemon] matched rule: /Users/pdesjardins/code/ocgraphqlserver/build/dist/graphql/schemas//* [2] [nodemon] changes after filters (before/after): 1/0 [2] [nodemon] files triggering change check: build/dist/graphql/schemas/ocadmin/org.graphql [2] [nodemon] matched rule: /Users/pdesjardins/code/ocgraphqlserver/build/dist/graphql/schemas//* [2] [nodemon] changes after filters (before/after): 1/0 [2] [nodemon] files triggering change check: build/dist/graphql/schemas/ocadmin/org.graphql [2] [nodemon] matched rule: /Users/pdesjardins/code/ocgraphqlserver/build/dist/graphql/schemas/**/* [2] [nodemon] changes after filters (before/after): 1/0
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (7 by maintainers)
Commits related to this issue
- fix: to avoid confusion like in #1528, always report used extension — committed to bleadof/nodemon by deleted user 5 years ago
- fix: to avoid confusion like in #1528, always report used extension — committed to remy/nodemon by deleted user 5 years ago
- choe: merge master * refs/remotes/origin/master: fix: to avoid confusion like in #1528, always report used extension fix: langauge around "watching" (#1591) docs: README Grammar (#1601) — committed to remy/nodemon by remy 5 years ago
for those still struggling with nodemon + ts files, im using nodemon 1.19.4, and created this configuration file:
It’s more that I’m not super keen on spending time getting wound up by your reply during the weekend (or the weekdays if I’m honest).
Anyway, from what I’ve determined from your latest comment on the issue, is that in your particular situation, you think it’s hard to solve, so you don’t (I’m guessing) want to try to debug and fix (understandably because it’s hard to debug and get tests passing and to actually ensure the original issue has been addressed in a way you can confirm - this is frustratingly a unique aspect of nodemon).
Which is probably the same reason no one else has ever taken a shot at it (you mention this has been raised again and again).
But sure, it’s left to me. I’ll attack this issue when it affects me. During my day to day dev I’ve not encountered this (because my workflow is different), but the day it’s a problem, I’ll consider (and likely) raise a PR against nodemon to get it fixed.
Of course, again, if there’s a PR for this, you all guessed right, I’ll happily merge.
Goodnight folks. Going back my family. Have a good (or better) weekend.
On Sat, 28 Sep 2019, 18:42 David Nunez, notifications@github.com wrote: