docs: update lifecycle hooks (#29678)

This commit is contained in:
xjccc 2024-10-25 16:55:05 +08:00 committed by Daniel Roe
parent 084471ce09
commit 4dbf5d3ba7
No known key found for this signature in database
GPG Key ID: CBC814C393D93268

View File

@ -52,7 +52,8 @@ Hook | Arguments | Description
`build:manifest` | `manifest` | Called during the manifest build by Vite and webpack. This allows customizing the manifest that Nitro will use to render `<script>` and `<link>` tags in the final HTML.
`builder:generateApp` | `options` | Called before generating the app.
`builder:watch` | `event, path` | Called at build time in development when the watcher spots a change to a file or directory in the project.
`pages:extend` | `pages` | Called after pages routes are resolved.
`pages:extend` | `pages` | Called after page routes are scanned from the file system.
`pages:resolved` | `pages` | Called after page routes have been augmented with scanned metadata.
`pages:routerOptions` | `{ files: Array<{ path: string, optional?: boolean }> }` | Called when resolving `router.options` files. Later items in the array override earlier ones.
`server:devHandler` | `handler` | Called when the dev middleware is being registered on the Nitro dev server.
`imports:sources` | `presets` | Called at setup allowing modules to extend sources.