diff --git a/lib/serve.js b/lib/serve.js index 5966386..4e33340 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 SIGNUSR2 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)