Unverified Commit efdc026a authored by Steven's avatar Steven Committed by GitHub

chore(docs): explain `NODE_ENV` environment variable (#52003)

This PR documents the `NODE_ENV` environment variable behavior.

This feature was originally added in
152c2c2a which was released in `next@5`.

See the current source code here:


https://github.com/vercel/next.js/blob/e3e76a45ee2b10e91b4e285fea536e42cf8e60e2/packages/next/src/bin/next.ts#L82

---------
parent 07591042
...@@ -168,3 +168,4 @@ For example, if `NODE_ENV` is `development` and you define a variable in both `. ...@@ -168,3 +168,4 @@ For example, if `NODE_ENV` is `development` and you define a variable in both `.
## Good to know ## Good to know
- If you are using a [`/src` directory](/docs/app/building-your-application/configuring/src-directory), `.env.*` files should remain in the root of your project. - If you are using a [`/src` directory](/docs/app/building-your-application/configuring/src-directory), `.env.*` files should remain in the root of your project.
- If the environment variable `NODE_ENV` is unassigned, Next.js automatically assigns `development` when running the `next dev` command, or `production` for all other commands.
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