The Generator Class

Hooks

generate: hooks:

HookArgumentsWhen
generate:before(generator, generateOptions)Hook on before generation
generate:distRemoved(generator)Hook on destination folder cleaned
generate:distCopied(generator)Hook on copy static and built files
generate:route({ route, setPayload })Hook before generating the page, useful for dynamic payload, see #7422, available for Nuxt 2.13+
generate:page({ route, path, html })Hook to let user update the path & html after generation
generate:routeCreated({ route, path, errors })Hook on saving generated page success
generate:extendRoutes(routes)Hook to let user update the routes to generate
generate:routeFailed({ route, errors })Hook on saving generated page failure
generate:done(generator, errors)Hook on generation finished
On this page