mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt): merge and apply layer hooks (#24639)
This commit is contained in:
parent
2193891778
commit
0c832465ec
@ -51,7 +51,11 @@ export function createNuxt (options: NuxtOptions): Nuxt {
|
||||
|
||||
async function initNuxt (nuxt: Nuxt) {
|
||||
// Register user hooks
|
||||
nuxt.hooks.addHooks(nuxt.options.hooks)
|
||||
for (const config of nuxt.options._layers.map(layer => layer.config).reverse()) {
|
||||
if (config.hooks) {
|
||||
nuxt.hooks.addHooks(config.hooks)
|
||||
}
|
||||
}
|
||||
|
||||
// Set nuxt instance for useNuxt
|
||||
nuxtCtx.set(nuxt)
|
||||
|
Loading…
Reference in New Issue
Block a user