webpack-hot-middleware
webpack-hot-middleware copied to clipboard
Stop watching for compilations at runtime.
Currently once you start running this middleware it will continue to watch for compilations and keep the EventSource open no matter what you do.
It would be nice if there was a way to programatically stop this middleware similar to webpack-dev-middleware's #close function.
I'd take a PR which adds this capability - what scenarios do you need this for?
Is it just to provide a way to cleanly shutdown?
Yes, I have a server that I am closing and restarting but this middleware acts funky when I do so.
Ok, it should be a case of going through the open sockets for the server-sent-events connections and disconnecting them.
Yeah more or less. Should also remove the plugin handlers from webpack.