docs: describe environment override feature (#21879)

This commit is contained in:
Aditya Rawat 2023-07-01 19:09:07 +05:30 committed by GitHub
parent 87e01ccf0e
commit 6cf762f169
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -29,6 +29,27 @@ Every configuration option is described in the [Configuration Reference](/docs/a
You don't have to use TypeScript to build an application with Nuxt. However, it is strongly recommended to use the `.ts` extension for the `nuxt.config` file. This way you can benefit from hints in your IDE to avoid typos and mistakes while editing your configuration.
::
### Environment overrides
You can configure fully typed, per-environment overrides in your nuxt.config
```ts [nuxt.config.ts]
export default defineNuxtConfig({
$production: {
routeRules: {
'/**': { isr: true }
}
},
$development: {
//
}
})
```
::alert{type=info}
If you're authoring layers, you can also use the `$meta` key to provide metadata that you or the consumers of your layer might use.
::
### Environment Variables and Private Tokens
The `runtimeConfig` API exposes values like environment variables to the rest of your application. By default, these keys are only available server-side. The keys within `runtimeConfig.public` are also available client-side.