I think this is important
Can you give an example of why you think it's important?
when working on any codebase, removing or renaming files is just as important as editing them and servers should restart!
working on many node.js projects i often remove\rename a file and refresh the page to see the updated version but I don't untill I manually restart :(
can you give me a reason why nodemon shouldn't restart on these events :D ?
I'm not saying it's stuck in stone, but sure: deleting a file doesn't
change your codebase (logically) until you _also_ change the references to
that file.
For instance. If you delete foo.js you will also remove the require
('./foo.js') from bar.js - which _will_ trigger a restart. Same applies to
a rename.
Like I said, I'm not stuck in stone on this, you just asked for an example.
I'm open to a PR for this if it also includes tests.
On Mon, 28 Sep 2015 13:31 Ahmed Hassanein [email protected] wrote:
when working on any codebase, removing or renaming files is just as
important as editing them and servers should restart!
working on many node.js projects i often remove\rename a file and refresh
the page to see the updated version but I don't untill I manually restart :(
can you give me an example why nodemon shouldn't restart on these events
:D ?—
Reply to this email directly or view it on GitHub
https://github.com/remy/nodemon/issues/656#issuecomment-143729380.
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
one example would be code that uses a list of files/folders. this doesn't require a code change but does need a restart to be detected. thats probably what I had 2 years ago but honestly I don't even remember lol
Merry christmas 🎄
My bot automatically loads plugins from a folder without an explicit require() for each plugin. It would be useful if nodemon could detect files being renamed/deleted so the bot can be restarted to unload plugins.
I have the same use case as @nyuszika7h I have a little utility server that scans a directory for the presence of files. If files are deleted the server should be restarted.
+1 i have auto-import too and i need reboot when deleting file
Let's say you have 2 scripts in package.json:
"scripts": {
"build": "npm install && rm -rf ./build && ./node_modules/.bin/tsc -p tsconfig.json",
"dev": "nodemon ./build/",
}
You want to run nodemon from 'build' folder. But, when you run "npm run build' command, which deletes 'build' folder and creates a new one, nodemon does not restart. You have to manually type 'rs' to restart it. This is unconvinient.
Not sure it is related to this issue, but it seems it is.
Most helpful comment
My bot automatically loads plugins from a folder without an explicit
require()for each plugin. It would be useful if nodemon could detect files being renamed/deleted so the bot can be restarted to unload plugins.