Unverified Commit 0bd3422b authored by Soonwoo Hong's avatar Soonwoo Hong Committed by GitHub

docs: Add notes about NEXT_MANUAL_SIG_HANDLE (#43686)

It seems that setting `NEXT_MANUAL_SIG_HANDLE` in `.env` file is not working, so I added some notes.

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
parent 324de6bf
...@@ -136,7 +136,18 @@ Next.js will automatically load the latest version of your application in the ba ...@@ -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`. 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 ```js
// pages/_document.js // pages/_document.js
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment