webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

Stop watching for compilations at runtime.

Open DylanPiercey opened this issue 8 years ago • 4 comments

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.

DylanPiercey avatar Feb 19 '17 21:02 DylanPiercey

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?

glenjamin avatar Feb 19 '17 22:02 glenjamin

Yes, I have a server that I am closing and restarting but this middleware acts funky when I do so.

DylanPiercey avatar Feb 20 '17 17:02 DylanPiercey

Ok, it should be a case of going through the open sockets for the server-sent-events connections and disconnecting them.

glenjamin avatar Feb 22 '17 09:02 glenjamin

Yeah more or less. Should also remove the plugin handlers from webpack.

DylanPiercey avatar Feb 22 '17 15:02 DylanPiercey