Skip to content

Commit 5b667e4

Browse files
docs: mention the building variable to execute non-prerenderable code in server handle (#13153)
* Update 20-hooks.md * Update documentation/docs/30-advanced/20-hooks.md --------- Co-authored-by: Elliott Johnson <[email protected]>
1 parent 58eb46a commit 5b667e4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export async function handle({ event, resolve }) {
3939
4040
If unimplemented, defaults to `({ event, resolve }) => resolve(event)`.
4141

42+
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.
43+
4244
### locals
4345

4446
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.

0 commit comments

Comments
 (0)