mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 13:48:13 +00:00
docs: add note about runtime config serialization (#8432)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
6bcd9cdeb1
commit
7b20e13c85
@ -39,6 +39,12 @@ console.log(runtimeConfig.public.apiBase)
|
||||
When using Options API the public runtime config is available via `this.$config.public`.
|
||||
::
|
||||
|
||||
### Serialization
|
||||
|
||||
Your runtime config will be serialized before being passed to Nitro. This means that anything that cannot be serialized and then deserialized (such as functions, Sets, Maps, and so on), should not be set in your `nuxt.config`.
|
||||
|
||||
Instead of passing non-serializable objects or functions into your application from your `nuxt.config`, you can place this code in a Nuxt or Nitro plugin or middleware.
|
||||
|
||||
### Environment Variables
|
||||
|
||||
The most common way to provide configuration is by using [Environment Variables](https://medium.com/chingu/an-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa).
|
||||
|
Loading…
Reference in New Issue
Block a user