← Back
Cloudflare
Cloudflare Vite plugin adds React Server Components support with child environments

React Server Components Integration

The Cloudflare Vite plugin now provides seamless integration with @vitejs/plugin-rsc, the official Vite plugin for React Server Components. This enables developers to build RSC-based applications on Cloudflare Workers with improved tooling support.

New Child Environments Feature

A childEnvironments option has been added to the plugin configuration, allowing developers to use multiple environments within a single Worker. This enables the parent environment to import modules from child environments, creating separate module graphs as needed.

Configuration Example

export default defineConfig({
  plugins: [
    cloudflare({
      viteEnvironment: {
        name: "rsc",
        childEnvironments: ["ssr"],
      },
    }),
  ],
});

Framework Support

The @vitejs/plugin-rsc provides foundational functionality that modern frameworks like React Router build upon. Developers can reference the official Cloudflare example in the Vite plugin repository to get started with RSC-powered applications on Workers.