Module hooks documentation

derevandal
50
derevandal
commented 2 years ago

Hi,

Where are module hooks documentation?
The link in released v.1.0.0 is broken.
Could anyone help me?

Thanks.

0
NicoPennec
1.7k
NicoPennec
commented 2 years ago

@derevandal

from doc: https://nuxtjs.org/guide/modules#run-tasks-on-specific-hooks

or

from the github doc repository: https://github.com/nuxt/docs/blob/c6493850060aa798542abcc811ced23c3c401fab/en/guide/modules.md#run-tasks-on-specific-hooks

module.exports = function () {
  // Add hook for modules
  this.nuxt.hook('module', moduleContainer => {
    // This will be called when all modules finished loading
  })

  // Add hook for renderer
  this.nuxt.hook('renderer', renderer => {
    // This will be called when renderer was created
  })

  // Add hook for build
  this.nuxt.hook('build', async builder => {
    // This will be called once when builder created

    // We can even register internal hooks here
    builder.hook('compile', ({compiler}) => {
        // This will be run just before webpack compiler starts
    })
  })

  // Add hook for generate
  this.nuxt.hook('generate', async generator => {
    // This will be called when a Nuxt generate starts
  })
}
0
derevandal
50
derevandal
commented 2 years ago

Thanks, bro!

De: Nicolas PENNEC
Enviado:terça-feira, 20 de março de 2018 14:41
Para: nuxt/nuxt.js
Cc:André Van Dal; Mention
Assunto: Re: [nuxt/nuxt.js] Module hooks documentation (#3069)

@derevandal see the github doc repository https://github.com/nuxt/docs/blob/c6493850060aa798542abcc811ced23c3c401fab/en/guide/modules.md#run-tasks-on-specific-hooks

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

0
Informations
QuestionResolved
#c2656 - Created 2 years ago