1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Improve documentation on runtime configuration (#4756)

* Remove nesting of runtime configuration under the babel section, since it's not related to babel.
* Clean up confusing verbiage relating to "keys."
This commit is contained in:
Jacob Page 2018-07-10 14:02:45 -07:00 committed by Tim Neutkens
parent ad2d4432e7
commit d51245b877

View file

@ -62,7 +62,7 @@ Next.js is a minimalistic framework for server-rendered React applications.
- [Configuring the build ID](#configuring-the-build-id) - [Configuring the build ID](#configuring-the-build-id)
- [Customizing webpack config](#customizing-webpack-config) - [Customizing webpack config](#customizing-webpack-config)
- [Customizing babel config](#customizing-babel-config) - [Customizing babel config](#customizing-babel-config)
- [Exposing configuration to the server / client side](#exposing-configuration-to-the-server--client-side) - [Exposing configuration to the server / client side](#exposing-configuration-to-the-server--client-side)
- [CDN support with Asset Prefix](#cdn-support-with-asset-prefix) - [CDN support with Asset Prefix](#cdn-support-with-asset-prefix)
- [Production deployment](#production-deployment) - [Production deployment](#production-deployment)
- [Static HTML export](#static-html-export) - [Static HTML export](#static-html-export)
@ -1359,9 +1359,9 @@ These presets / plugins **should not** be added to your custom `.babelrc`. Inste
The `modules` option on `"preset-env"` should be kept to `false` otherwise webpack code splitting is disabled. The `modules` option on `"preset-env"` should be kept to `false` otherwise webpack code splitting is disabled.
#### Exposing configuration to the server / client side ### Exposing configuration to the server / client side
The `config` key allows for exposing runtime configuration in your app. All keys are server only by default. To expose a configuration to both the server and client side you can use the `public` key. The `next/config` module gives your app access to runtime configuration stored in your `next.config.js`. Place any server-only runtime config under a `serverRuntimeConfig` property and anything accessible to both client and server-side code under `publicRuntimeConfig`.
```js ```js
// next.config.js // next.config.js