Vite plugin for React Server Components (RSC) that transforms React components into native ESM modules, enabling static site generation, dynamic servers, and portable RSC payloads compatible with any HTTP server. Version 2.0.1 requires React 19.2+ and Node ^23.7.0, bundles the react-server-dom-esm transport via react-server-loader, and ships TypeScript types. Key differentiators: no experimental React builds needed, automatic client module detection via filename pattern or "use client" directive, built-in support for third-party client packages via peerDep detection, and a Storybook preset. Released under MIT, with active development on GitHub.
npm install vite-plugin-react-serverNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal Vite config with a single server component page, plus dev and build commands.
Upgrade React to 19.2.7 or later and Node to 23.7.0 or later.
Remove any manual react-server-dom-esm or experimental React dependencies; ensure react-server-loader is in node_modules.
Migrate imports to the main package entry 'vite-plugin-react-server'.
Wrap the library's provider in a component that starts with 'use client' (e.g., 'ClientProvider.tsx').
Rename files to Button.client.tsx, App.client.tsx, or add "use client"; directive at top.
Ensure ./.storybook/main.ts imports the preset and adds vitePluginReactServer plugin.
Use ESM import syntax: import { vitePluginReactServer } from 'vite-plugin-react-server'.Install explicitly: npm install -D react-server-loader.
Verify moduleBase resolves correctly and Page export name matches the filename's named export.
Wrap the library component in a 'use client' file and re-export.