API: The Generator Class


We can register hooks on certain life cycle events.

Hook Arguments When
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:page ({route, path, html}) Hook to let user update the path & html
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


Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!

Platinum Sponsors

Storyblok Support Us