Skip to content

Commit

Permalink
fix: export init hook from get_hooks (#13136)
Browse files Browse the repository at this point in the history
* fix: export `init` hook from `get_hooks`

* Create sour-pigs-talk.md

* fix: create `init` variable
  • Loading branch information
paoloricciuti authored Dec 10, 2024
1 parent 50ec8e9 commit 4ff86e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sour-pigs-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/kit": patch
---

fix: export `init` hook from `get_hooks`
4 changes: 3 additions & 1 deletion packages/kit/src/core/sync/write_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export async function get_hooks() {
let handle;
let handleFetch;
let handleError;
${server_hooks ? `({ handle, handleFetch, handleError } = await import(${s(server_hooks)}));` : ''}
let init;
${server_hooks ? `({ handle, handleFetch, handleError, init } = await import(${s(server_hooks)}));` : ''}
let reroute;
${universal_hooks ? `({ reroute } = await import(${s(universal_hooks)}));` : ''}
Expand All @@ -77,6 +78,7 @@ export async function get_hooks() {
handleFetch,
handleError,
reroute,
init,
};
}
Expand Down

0 comments on commit 4ff86e1

Please sign in to comment.