Skip to content

feat(kit): add useRuntimeConfig and updateRuntimeConfig utils#27117

Merged
danielroe merged 5 commits intomainfrom
feat/kit-runtime-config
May 9, 2024
Merged

feat(kit): add useRuntimeConfig and updateRuntimeConfig utils#27117
danielroe merged 5 commits intomainfrom
feat/kit-runtime-config

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #26960
resolves #24224

📚 Description

In line with this suggestion, this PR adds two new Kit utilities:

  • useRuntimeConfig - this allows accessing nuxt.options.nitro.runtimeConfig, with the configuration resolved/expanded with environment variables
  • updateRuntimeConfig - this allows deep-updating nuxt.options.nitro.runtimeConfig (and also triggering a Nitro HMR if it has already initialised)

In addition, nuxt.options.runtimeConfig is synced with nuxt.options.nitro.runtimeConfig and Nitro runtimeConfig resolution is moved into @nuxt/schema rather than kept directly within Nuxt.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@socket-security
Copy link
Copy Markdown

socket-security bot commented May 8, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

View full report↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve runtimeConfig within nuxt options Runtime config is not replaced by env variables in the module

2 participants