Closed bsnbsn closed 10 months ago
Great idea, thanks for the PR :)
I wonder if we should keep the unlink in the buildStart
hook, just to make sure? (although I can't think of a situation where your unlink wouldn't have already removed the file)
I think that this is not necessary. But if you prefer to keep unlink in buildStart
then I can revert this change.
Alright I agree. Can you explain what the exitHandlersBound
is doing? Might the configureServer
hook be called multiple times and so we have to make sure to add the clean
function only once?
Maybe I can give some clarity around this which might help.
exitHandlersBound
flag is used here to ensure that the exit handlers are set up only once. It prevents the exit handlers from being bound multiple times in the same session, it handles multiple invocations of the configureServer
hook without the risk of registering exit handlers multiple times.
Overall these exit handlers will cover common scenarios where the server stops, although there might be exceptional scenarios or external factors (like forcefully killed, crashes, system shutdown/restart, etc.) not covered by these handlers so it's up to you if you want to keep the clean
in the buildStart
as well.
thanks for the explanation @bogdancondorachi! I'm a bit busy at the moment but will merge the PR this week and add the cleanup on buildStart
again just to be sure
Hello, while using this plugin, I noticed that the .dev file persists until the next build task. I thought it would be handy to remove the .dev file after closing the development server. :-)