Back to Nuxt

App Config

docs/4.api/5.kit/11.app-config.md

4.5.2606 B
Original Source

updateAppConfig

Update the app configuration that will be applied to nuxt.options.appConfig. This is useful for modules to set default values that can be overridden by user configuration. The update is merged with the existing configuration using defu.

Type

ts
function updateAppConfig (appConfig: Record<string, unknown>): void

Example

ts
import { defineNuxtModule, updateAppConfig } from '@nuxt/kit'

export default defineNuxtModule({
  setup () {
    updateAppConfig({
      myModule: {
        option: 'value',
      },
    })
  },
})