mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
docs: describe environment override feature (#21879)
This commit is contained in:
parent
87e01ccf0e
commit
6cf762f169
@ -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.
|
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
|
### 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.
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user