⚠
vite-plugin-ssr has been renamed Vike, see migration guide.

client

The client config is part of the V1 design.

The client config adds client-side code executed at load time.

For executing code upon page lifecycle changes, see following hooks instead: onHydrationEnd(), onPageTransitionStart(), and onPageTransitionEnd().

// +config.h.js
export default {
  client: './some-client-code.js'
}
// some-client-code.js
console.log("I'm run when the client-side JavaScript is loaded.")

Example

See /examples/render-modes-v1/pages/html-js/+client.js.