← Back to search

1.51.2 / compatible

@cloudflare/vite-plugin

Cloudflare plugin for Vite

Install dependency
v add @cloudflare/vite-plugin
Published
Aug 10, 2026
License
MIT
weekly downloads
5,238,466
Compatibility
Vite compatible ^6.1.0 || ^7.0.0 || ^8.0.0 · Rollup unknown · Rolldown unknown
Categories
deployment
Keywords
cloudflare, cloudflare-workers, vite, vite-plugin, workers

Published README

@cloudflare/vite-plugin

The Cloudflare Vite plugin enables a full-featured integration between Vite and the Workers runtime. Your Worker code runs inside workerd, matching the production behavior as closely as possible and providing confidence as you develop and deploy your applications.

// vite.config.ts

import { defineConfig } from "vite";
import { cloudflare } from "@cloudflare/vite-plugin";

export default defineConfig({
  plugins: [cloudflare()],
});

Documentation

Full documentation can be found here.

Features

  • Uses the Vite Environment API to integrate Vite with the Workers runtime
  • Provides direct access to Workers runtime APIs and bindings
  • Builds your front-end assets for deployment to Cloudflare, enabling you to build static sites, SPAs, and full-stack applications
  • Official support for TanStack Start and React Router v8 with server-side rendering
  • Leverages Vite's hot module replacement for consistently fast updates
  • Supports vite preview for previewing your build output in the Workers runtime prior to deployment

Use cases

  • TanStack Start
  • React Router v8
  • Support for more full-stack frameworks is coming soon
  • Static sites, such as single-page applications, with or without an integrated backend API
  • Standalone Workers
  • Multi-Worker applications