I have a lerna script (lerna dev
) that boots up several package's dev servers with the --parallel
option (if I didn't use that option, only the first service would start, but not the others). These servers serve their respective apps in dev mode on different ports, with hot reload. Basically, this allows smooth development, as we only have to enter one command to start working on several packages.
The problem I've noticed is that when I interrupt this lerna task, servers don't get shut down. When I run my lerna dev
command, it prints messages explaining servers are already running on the ports they use. What this means is, when I shutdown the lerna dev
command (with CTRL+C), it doesn't kill all of those running processes (some are killed, some aren't).
Interestingly enough, those that don't shutdown are create-react-app projects
.
So here's my question: how do I make sure processes started via the lerna run
command with the --parallel
option are all killed alongside the main process?
PS: this happens on Unix systems, we don't use Windows.