From 14e48177470dbae46e7e6b4182a13777aab17e5d Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Tue, 24 Oct 2017 15:38:25 +0200 Subject: [PATCH] Emit SIGNUSR2 to signal restart to user code --- bin/serve/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/serve/index.js b/bin/serve/index.js index 86aacff..9634323 100755 --- a/bin/serve/index.js +++ b/bin/serve/index.js @@ -8,6 +8,8 @@ const listenMessage = require('./listen-message') const getPort = require('./get-port') module.exports = async ({ filename, pkg, cli, restarting }) => { + if (restarting) process.emit('SIGNUSR2') + const { userPort, port, inUse } = await getPort(cli) const filepath = path.resolve(process.cwd(), filename)