mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
feat(kit): allow module defaults to be async
This commit is contained in:
parent
270dfb8c63
commit
ba29fc031a
@ -65,7 +65,7 @@ function _defineNuxtModule<
|
|||||||
|
|
||||||
const optionsDefaults: TOptionsDefaults =
|
const optionsDefaults: TOptionsDefaults =
|
||||||
module.defaults instanceof Function
|
module.defaults instanceof Function
|
||||||
? module.defaults(nuxt)
|
? await module.defaults(nuxt)
|
||||||
: module.defaults ?? <TOptionsDefaults> {}
|
: module.defaults ?? <TOptionsDefaults> {}
|
||||||
|
|
||||||
let options = defu(inlineOptions, nuxtConfigOptions, optionsDefaults)
|
let options = defu(inlineOptions, nuxtConfigOptions, optionsDefaults)
|
||||||
|
@ -64,7 +64,7 @@ export interface ModuleDefinition<
|
|||||||
TWith extends boolean,
|
TWith extends boolean,
|
||||||
> {
|
> {
|
||||||
meta?: ModuleMeta
|
meta?: ModuleMeta
|
||||||
defaults?: TOptionsDefaults | ((nuxt: Nuxt) => TOptionsDefaults)
|
defaults?: TOptionsDefaults | ((nuxt: Nuxt) => Awaitable<TOptionsDefaults>)
|
||||||
schema?: TOptions
|
schema?: TOptions
|
||||||
hooks?: Partial<NuxtHooks>
|
hooks?: Partial<NuxtHooks>
|
||||||
setup?: (
|
setup?: (
|
||||||
|
Loading…
Reference in New Issue
Block a user