Vite plugin (2)
Last updated Oct 18, 2026
The Cloudflare Vite plugin enables a full-featured integration between Vite ↗︎ and the Workers runtime. Your Worker code runs inside a local workerd ↗︎ process, which closely matches the runtime APIs and behavior of deployed Workers.
Miniflare is not a hardened sandbox
Do not use Miniflare to run untrusted or potentially malicious Worker code directly on your machine. Run the entire development process inside an appropriate secure sandbox, such as a virtual machine.
Miniflare starts a local workerd ↗︎ process. This warning applies to default local execution with wrangler dev, vite dev, vite preview, direct Miniflare use, and Miniflare-based testing tools. Setting remote: true on a binding changes which resource your code accesses, but your Worker code still executes locally. By contrast, legacy wrangler dev --remote executes your Worker code on Cloudflare.
Miniflare is not a security boundary for untrusted code. Although workerd attempts to restrict Worker code to configured resources, an implementation bug could allow code to escape those restrictions. The hosted Workers platform applies additional layers of defense in depth that Miniflare does not provide locally.
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
- Produces standard Build Output for
cf buildandcf deploy - 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 previewfor previewing your build output in the Workers runtime prior to deployment
Use cases
- TanStack Start ↗︎
- React Router v8 ↗︎
- Static sites, such as single-page applications, with or without an integrated backend API
- Standalone Workers
- Multi-Worker applications
Get started
To create a new application from a ready-to-go template, refer to the TanStack Start, React Router, React or Vue framework guides.
To create a standalone Worker from scratch, refer to Get started.
For a more in-depth look at adapting an existing Vite project and an introduction to key concepts, refer to the Tutorial.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/workers/vite-plugin/#page","headline":"Vite plugin","description":"A full-featured integration between Vite and the Workers runtime","url":"https://developers.cloudflare.com/workers/vite-plugin/","inLanguage":"en","image":"https://developers.cloudflare.com/workers/vite-plugin/og.png?v=e1b8c6ccd311410c","dateModified":"2026-10-18","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Get started with the Vite plugin title: Get started image: https://developers.cloudflare.com/workers/vite-plugin/get-started/og.png?v=2eb6967b7d478d0d
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/workers/llms.txt
Use this file to discover all available pages before exploring further.
Docs