The Cloudflare Vite plugin has reached 1.0, and with it comes official support for React Router v7. The plugin's central change is that your Worker code no longer runs under Node.js in development: it executes inside workerd, the native Cloudflare Workers runtime, via the Environment API that shipped experimentally in Vite 6.
That API is the enabler. It lets the Vite dev server talk to any number of custom runtime environments, so server code can target a non-Node JavaScript runtime without leaving Vite. Cloudflare says it designed and implemented the API closely with the Vite team.

In the resulting flow, Vite resolves, loads and transforms source files into modules for both the client and Worker environments. Client modules go to the browser as client-side JavaScript; Worker modules are sent to the Workers runtime to handle server requests, and the dev server returns the Worker's response to the browser.
SPAs and Workers Assets
SPAs remain Vite's home turf, and the plugin covers them. A new React SPA can be scaffolded with the create-cloudflare CLI, which runs create-vite and then applies the configuration needed for the plugin.
npm create cloudflare@latest my-react-app -- --framework=react --platform=workers
Converting an existing Vite SPA takes two steps. First, add @cloudflare/vite-plugin to the plugins list:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { cloudflare } from "@cloudflare/vite-plugin";
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), cloudflare()],
});
Then add a wrangler.jsonc next to the Vite config:
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "my-react-app",
"compatibility_date": "2025-04-01",
"assets": {
"not_found_handling": "single-page-application",
},
}
For a front-end-only app, the plugin wires the dev server to Workers Assets so options like html_handling and not_found_handling behave as they do in production. Adding a Worker backend is where the dev and deploy workflow becomes a single loop.
The dev loop in practice
Start the dev server with the command that runs your Worker in the Workers runtime:
npm run dev
The template's SPA increments a counter in the browser, and a second button fetches from the API, displaying Name from API is: Cloudflare. That request is served by the Worker in api/index.ts, which handles any request not matching a static asset and returns JSON when pathname starts with /api/.
Change the returned name to 'Cloudflare Workers' and save. Clicking the button again shows the new value while the counter keeps its value: Vite updated only the Worker environment, leaving client state intact.
The integration extends past dev. vite build produces the client and server output in one command, vite preview runs the build in the Workers runtime, and wrangler deploy detects a Vite build and deploys it without extra bundling.
React Router v7 without adapters
Vite has become the base for full-stack frameworks including Astro, Qwik, React Router and SvelteKit, and Cloudflare worked with the Remix team on their Vite Environments adoption. React Router v7, Remix's successor, now has first-class support in the plugin, scaffoldable through create-cloudflare:
npm create cloudflare@latest my-react-router-app -- --framework=react-router
From there, npm run dev, build, preview and deploy cover the workflow. The file referenced by main in wrangler.jsonc is workers/app.ts:
const requestHandler = createRequestHandler(
() => import("virtual:react-router/server-build"),
import.meta.env.MODE
);
export default {
async fetch(request, env, ctx) {
return requestHandler(request, {
cloudflare: { env, ctx },
});
},
} satisfies ExportedHandler<CloudflareEnvironment>;
One file defines the Worker for both dev and build, so build-time adapters are no longer needed. The env and ctx passed in the request handler reach loaders and actions running in the Workers runtime. Additional exports can be added, such as a Durable Object or a Workflow. Cloudflare says React Router v7 is the first of a series of full-stack frameworks it will support, and invites framework contributors to use the plugin code and reach out on GitHub or Discord.
Beyond web apps
The plugin builds anything Workers can run, with the full developer platform supported: KV, D1, Service Bindings, RPC, Durable Objects, Workflows, Workers AI and more. Moving an existing Worker to Vite usually means installing dependencies:
npm install –save-dev vite @cloudflare/vite-plugin
and adding a Vite config:
// vite.config.ts
import { defineConfig } from "vite";
import { cloudflare } from "@cloudflare/vite-plugin";
export default defineConfig({
plugins: [cloudflare()],
});
By default the plugin looks for wrangler.json, wrangler.jsonc or wrangler.toml at the root of the Vite project. Vite's plugin ecosystem is then available for customizing build output.
This fulfills a direction Cloudflare sketched in 2024 when it introduced getPlatformProxy() for reaching bindings from Node-based dev servers, describing a future of developing directly in the Workers runtime and thereby closing the subtle gaps between dev and production. New projects can start from the React Router, React or Vue templates via create-cloudflare, and broader documentation is available for the plugin.



