Compare commits

...

2 Commits

Author SHA1 Message Date
Inesh Bose
13bcf24cc0
Merge ba29fc031a into 9bf8465806 2024-11-19 23:30:27 +02:00
Inesh Bose
ba29fc031a
feat(kit): allow module defaults to be async 2024-11-19 18:54:08 +00:00
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ function _defineNuxtModule<
const optionsDefaults: TOptionsDefaults =
module.defaults instanceof Function
? module.defaults(nuxt)
? await module.defaults(nuxt)
: module.defaults ?? <TOptionsDefaults> {}
let options = defu(inlineOptions, nuxtConfigOptions, optionsDefaults)

View File

@ -64,7 +64,7 @@ export interface ModuleDefinition<
TWith extends boolean,
> {
meta?: ModuleMeta
defaults?: TOptionsDefaults | ((nuxt: Nuxt) => TOptionsDefaults)
defaults?: TOptionsDefaults | ((nuxt: Nuxt) => Awaitable<TOptionsDefaults>)
schema?: TOptions
hooks?: Partial<NuxtHooks>
setup?: (