Skip to content

Commit

Permalink
docs: mention the building variable to execute non-prerenderable co…
Browse files Browse the repository at this point in the history
…de in server handle (#13153)

* Update 20-hooks.md

* Update documentation/docs/30-advanced/20-hooks.md

---------

Co-authored-by: Elliott Johnson <[email protected]>
  • Loading branch information
1 parent 58eb46a commit 5b667e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions documentation/docs/30-advanced/20-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export async function handle({ event, resolve }) {
If unimplemented, defaults to `({ event, resolve }) => resolve(event)`.

During prerendering, SvelteKit crawls your pages for links and renders each route it finds. Rendering the route invokes the `handle` function (and all other route dependencies, like `load`). If you need to exclude some code from running during this phase, check that the app is not [`building`]($app-environment#building) beforehand.

### locals

To add custom data to the request, which is passed to handlers in `+server.js` and server `load` functions, populate the `event.locals` object, as shown below.
Expand Down

0 comments on commit 5b667e4

Please sign in to comment.