clientHooks
The clientHooks setting determines whether the page loads client hooks.
If false then no client hook is loaded on the client-side (saving KBs).
+client.jsis always loaded, regardless of this setting. Set/override the value of theclientsetting tonullif you also want to skip loading+client.js.
The usual use case is to control what code is loaded on the client-side for HTML-only pages, see Render Modes (SPA, SSR, SSG, HTML-only) > HTML-only.
By default, Vike sets its value to true (client-side hooks are loaded) if and only if:
onRenderClient()is defined, andPageis defined and itsmeta.env.clientistrue.
Use this setting to override the default:
- Set to
falseif you want the page to skip loading client hooks (saving KBs). - Set to
trueif you want to make sure the page loads client hooks.