未验证 提交 d49c4742 编写于 作者: D Daniel Stumme 提交者: GitHub

Adding small note to ENV documentation (#20860)

This single sentence addition would have saved me about a day of troubleshooting. This doc doesn't mention how the inline occurs. The only place I could eventually find that mentions this is the server & public runtime config pages.
上级 77a2eeb1
......@@ -81,7 +81,7 @@ In order to expose a variable to the browser you have to prefix the variable wit
NEXT_PUBLIC_ANALYTICS_ID=abcdefghijk
```
This loads `process.env.NEXT_PUBLIC_ANALYTICS_ID` into the Node.js environment automatically, allowing you to use it anywhere in your code. The value will be inlined into JavaScript sent to the browser because of the `NEXT_PUBLIC_` prefix.
This loads `process.env.NEXT_PUBLIC_ANALYTICS_ID` into the Node.js environment automatically, allowing you to use it anywhere in your code. The value will be inlined into JavaScript sent to the browser because of the `NEXT_PUBLIC_` prefix. This inlining occurs at build time, so your various `NEXT_PUBLIC_` envs need to be set when the project is built.
```js
// pages/index.js
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册