Macil / browserify-hmr

Hot Module Replacement plugin for Browserify
MIT License
373 stars 26 forks source link

doesn't work well with nodemon #1

Closed morganrallen closed 9 years ago

morganrallen commented 9 years ago

I haven't had a chance to dive in deeply but it appears hmr spawns it's own process to manage the websockets server. When nodemon detects a code change and restarts the main process, hmr tries to listen on 3123 again, which is still in use by the previous instance.

Macil commented 9 years ago

I'm not sure I understand how browserify/watchify and nodemon would be used together. Can you create an example that shows the issue?

I see that if I send SIGTERM to the main process, the child process doesn't die. I can fix that soon but I don't know if it will fix the nodemon case without testing it.

morganrallen commented 9 years ago

I use both in my dev process, watchify used in the module form can prebuild the bundle before I reload a page, just speeds things up.

Macil commented 9 years ago

I just put version 0.2.2 up which should fix this issue. If the child process loses connection, it exits itself. (And if the builder process loses connection to the socket server, an error is triggered.)

morganrallen commented 9 years ago

nice!