App Config

Source
Nuxt Kit provides a set of utilities to help you access and modify Nuxt app configuration.

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

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

Example

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

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