⚠️
The vite-plugin-ssr project has been renamed Vike.
  • If you are using vite-plugin-ssr, migrate to Vike.
  • For new projects, use Vike instead of vite-plugin-ssr.
Vike itself (without extensions) is like vite-plugin-ssr: unopinionated and fully agnostic.

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.