updateSiteConfig()
Modify the site config at runtime. You can provide any config to this function, such as the recommended config.
When using this, you will need to run it as early as possible in the Nuxt lifecycle to avoid conflicts with other modules. It's recommended to use the Nitro updateSiteConfig API instead.
Usage
Returns a dispose function that removes the config entry from the stack when called.
plugins/site-config.server.ts
import { updateSiteConfig } from '#site-config/app'
export default defineNuxtPlugin({
enforce: 'pre', // make it happen early
setup() {
const dispose = updateSiteConfig({
name: 'My Site',
url: 'https://example.com',
})
// call dispose() to remove this config entry
}
})Was this page helpful?
Related
Was this page helpful?