diff --git a/build/tools/serve.js b/build/tools/serve.js index 960fc18d..09cff2c6 100644 --- a/build/tools/serve.js +++ b/build/tools/serve.js @@ -9,9 +9,12 @@ function spawnAndCheck(cmd, args, options) { const s = spawn(cmd, args, options); spawns.push(s); s.on('close', (code) => { - console.log(cmd, 'exited with code:', code); - spawns.forEach((s) => s.kill()); - process.exit(code); + spawns.splice(spawns.findIndex(s), 1); + if (code !== 0) { + console.log(cmd, 'exited with code:', code); + spawns.forEach((s) => s.kill()); + process.exit(code); + } }); }