未验证 提交 eeabb52b 编写于 作者: M Mayank Jethva 提交者: Joe Haddad

Update README.md (#6749)

- fix runtime configuration example to use `customKey`
- standardize warning callouts to use a block quote and bold "**Warning:**" text. Previously there were different ways a warning was mentioned on the docs page:
  - A warning emoji. The warning emoji didn't render in the actual site.
    <img width="770" alt="Screen Shot 2019-03-21 at 9 22 21 AM" src="https://user-images.githubusercontent.com/1103708/54759302-c655f380-4bbb-11e9-9116-b0fdc2467bc3.png">
  - Italicized "Warning" text. Imo, does not stand out on the page.
    <img width="663" alt="Screen Shot 2019-03-21 at 9 24 43 AM" src="https://user-images.githubusercontent.com/1103708/54759376-f604fb80-4bbb-11e9-85c6-6589b7738dee.png">
上级 ef9c39e2
......@@ -1536,7 +1536,7 @@ Some commonly asked for features are available as modules:
- [@zeit/next-preact](https://github.com/zeit/next-plugins/tree/master/packages/next-preact)
- [@zeit/next-typescript](https://github.com/zeit/next-plugins/tree/master/packages/next-typescript)
_Warning: The `webpack` function is executed twice, once for the server and once for the client. This allows you to distinguish between client and server configuration using the `isServer` property_
> **Warning:** The `webpack` function is executed twice, once for the server and once for the client. This allows you to distinguish between client and server configuration using the `isServer` property
Multiple configurations can be combined together with function composition. For example:
......@@ -1703,7 +1703,7 @@ export default Index
```
> **Warning:** Note that it is not possible to destructure process.env variables due to the webpack `DefinePlugin` replacing process.env.XXXX inline at build time
```js
```js
// Will not work
const { CUSTOM_KEY, CUSTOM_SECRET } = process.env;
AuthMethod({ key: CUSTOM_KEY, secret: CUSTOM_SECRET });
......@@ -1717,8 +1717,8 @@ AuthMethod({ key: process.env.CUSTOM_KEY, secret: process.env.CUSTOM_SECRET });
> **Warning:** Note that this option is not available when using `target: 'serverless'`
> :warning: Generally you want to use build-time configuration to provide your configuration.
> The reason for this is that runtime configuration adds a small rendering / initialization overhead.
> **Warning:** Generally you want to use build-time configuration to provide your configuration.
The reason for this is that runtime configuration adds a small rendering / initialization overhead.
The `next/config` module gives your app access to the `publicRuntimeConfig` and `serverRuntimeConfig` stored in your `next.config.js`.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册