diff --git a/lib/serve.js b/lib/serve.js index 5966386..a78c26c 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -11,6 +11,11 @@ module.exports = async (file, flags, restarting) => { // Ensure that the loaded files have the correct env process.env.NODE_ENV = process.env.NODE_ENV || 'development' + // Emit SIGUSR2 to signal restart to user code + if (restarting) { + process.emit('SIGNUSR2') + } + // And then load the files const module = flags.silent ? getModule(file) : log(getModule(file)) const server = serve(module)