remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.28k stars 1.73k forks source link

Nodemon not restarting if main file has no extension #904

Closed aalexgabi closed 6 years ago

aalexgabi commented 8 years ago

I have a js file without extension and when it's content changes nodemon doesn't restart it. I saw that we can specify file extension list but shouldn't the main file be supported with a shebang?

Any ideas how to fix this?

remy commented 8 years ago

It's not a great answer, if this is a node project, you can give it an extension, and just alias inside of your package.json (the same way nodemon does). If it's not…im not sure. Sorry.

aalexgabi commented 8 years ago

I fould a workaround:

$ nodemon --watch file-without-extension file-without-extension
stale[bot] commented 6 years ago

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. Thank you for contributing <3

entozoon commented 6 years ago

This problem does still exist. The workaround is fine but it is an unexpected problem regardless

yanicakj commented 5 years ago

@aalexgabi The issue with that workaround is nodemon will no longer watch parent directories (using --watch /bin/www appears files outside bin are not watched).

mholtzhausen commented 5 years ago

I created some node-based githooks and was using nodemon to rerun on changes. I added a lib folder with some shared code. when I run nodemon -w .githooks/ .githooks/pre-commit nodemon catches changes in .githooks/* but does not restart when .githooks/pre-commit is changed

I then tried nodemon -w .githooks/pre-commit. This sees changes to .githooks/pre-commit but nothing else.

I then tried nodemon -w .githooks/pre-commit -w .githooks/ .githooks/pre-commit. This sees changes to .githooks/* but not changes to .githooks/pre-commit

Frustrating...

entozoon commented 5 years ago

So it should be re-opened, right?

remy commented 5 years ago

Happy to reopen with a PR.

broofa commented 2 years ago

Submitting PR.

FWIW, my use case for this is that I need to run a script that does docker build any time a file in the current directory changes. If I donodemon --ext "*" -x build.sh, it doesn't restart whenDockerfile changes . Nor does using --ext Dockerfile work.