Skip to content

Commit

Permalink
fix(nuxt): merge and apply layer hooks (#24639)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 8, 2023
1 parent 2193891 commit 0c83246
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/nuxt/src/core/nuxt.ts
Expand Up @@ -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)
Expand Down

0 comments on commit 0c83246

Please sign in to comment.