Open Yomguithereal opened 8 years ago
A simple process.on('exit', () => child.kill())
can do the trick. However I notice that you use webpack to compile your published files and it will shim process and it's not a good thing. You should probably compile your lib using babel alone. Is there a reason for you to use webpack here?
Hi @Yomguithereal
I added your solution in e68764205bdb37e0eccb87e8af0e87c955f43396 and published a new minor version – I am pretty sure what webpack does not shim process because I configured to build a bundle for Node (and not the browser) so it should work.
@renke I am still having an issue with child processes not exiting. Any advice?
I tried a variety of similar packages and this issue happened with all of the following:
http-server
lr-http-server
webpack-dev-server
The first time, everything runs fine. If I quit overviewer and start it again, I get "port is already in use" type warnings. I then have to manually kill the process before restarting overviewer.
Children are not killed when overviewer quits. This is problematic with long running scripts such as servers etc.