diff --git a/docs/deployment.md b/docs/deployment.md index fc09ac4108fd..eb18e43310f5 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -136,7 +136,18 @@ Next.js will automatically load the latest version of your application in the ba Sometimes you might want to run some cleanup code on process signals like `SIGTERM` or `SIGINT`. -You can do that by setting the env variable `NEXT_MANUAL_SIG_HANDLE` to `true` and then register a handler for that signal inside your `_document.js` file. +You can do that by setting the env variable `NEXT_MANUAL_SIG_HANDLE` to `true` and then register a handler for that signal inside your `_document.js` file. Please note that you need to register env variable directly in the system env variable, not in the `.env` file. + +```json +// package.json +{ + "scripts": { + "dev": "NEXT_MANUAL_SIG_HANDLE=true next dev", + "build": "next build", + "start": "NEXT_MANUAL_SIG_HANDLE=true next start" + } +} +``` ```js // pages/_document.js