vite-ssr-components (v0.5.2) provides JSX components (Script, Link, ViteClient) and Vite plugins for SSR applications with Vite, particularly targeting Cloudflare deployments. It automates asset path resolution via manifest.json, client script injection, SSR hot reload, and build entry detection. Supports hono/jsx and React. Easy to set up with an SSR plugin that auto-scans Script/Link components for build input. Requires Node >=18.0.0.
npm install vite-ssr-componentsVerified import paths — ran on the pinned version, not inferred.
Shows how to add the SSR plugin to Vite config and use Script, Link, and ViteClient components in an SSR app.
Update your ssrPlugin() options to match the new names (see release notes).
Remove any custom manifest file configuration if using auto-detect; check that manifest.json exists in build output.
Use different names for custom components or specify custom component names in the plugin's `components` option.
Ensure Script/Link components are statically importable in scanned files.
Use ESM imports like `import { Script } from 'vite-ssr-components/hono'`.Ensure the package is installed: `npm i -D vite-ssr-components`, then use `import ssrPlugin from 'vite-ssr-components/plugin'`.
Use `import { Script } from 'vite-ssr-components/hono'` for hono/jsx or `'vite-ssr-components/react'` for React.Run `vite build` for the client (e.g., `vite build --outDir dist/client`) before starting the SSR server.
Call ssrPlugin() in the plugins array: `plugins: [ssrPlugin()]`.