Start with vinext
The smallest config for running a Next.js app through Vite.
Vinext is a Vite plugin that re-implements the Next.js API from scratch. Keep your app/, pages/, and next.config.js as they are. Get a faster dev loop, smaller bundles, and a clean path to deploy on any host.
Measured against Next.js 16 with Turbopack on a 33-route App Router benchmark app.
168.9 KB → 72.9 KB gzipped on the same benchmark. Tree-shaking and a lighter client runtime do the work.
App Router, Pages Router, RSC, server actions, ISR, middleware, route handlers. Coverage and gaps tracked openly.
Benchmarks are directional, not definitive. See the launch numbers and methodology in the announcement.
Vinext re-implements Next.js as a Vite plugin instead of wrapping its build output. That single decision unlocks a faster toolchain and a much wider set of deployment targets.
Keep your existing app/, pages/, and next.config.js. The full Next.js 16 API surface is shimmed — App Router, Pages Router, RSC, server actions, ISR, middleware, and the next/* module imports you already use.
Fast HMR, native ESM, and the Vite plugin ecosystem. Built on @vitejs/plugin-rsc for React Server Components, and ready for Rolldown — the Rust-based bundler shipping in Vite 8.
Cloudflare Workers is the first deployment target, with one-command deploys via vinext deploy. Vercel, Netlify, AWS, Deno Deploy, and more, work through Nitro, and standalone Node bundles are emitted on demand.
Caching, bindings, image optimization, and pre-rendering all work out of the box on Cloudflare Workers, with sensible defaults you can swap out when you need to.
Import env from cloudflare:workers directly inside server components, route handlers, and server actions. Bindings work in dev and production with no proxy layer.
Stale-while-revalidate with background regeneration, matching the Next.js 16 CacheHandler interface. A KV-backed handler ships by default; R2 or your own backend can drop in.
Pre-render only the pages real traffic hits, using zone analytics at deploy time. Popular pages get SSG-level latency without building tens of thousands of routes ahead of time.
Local images route through a runtime resize/transcode endpoint that integrates with the Cloudflare Images binding. Remote images use @unpic/react with auto-detection for 28 CDNs.
Real Next.js apps, rebuilt on every push to main and deployed to Cloudflare Workers. Source is on GitHub.
Vercel's official Next.js App Router Playground, running on vinext. Covers the breadth of App Router features — server components, parallel routes, streaming, error boundaries, metadata.
RSC-first Hacker News clone with streaming, nested layouts, and server actions. A good look at what an idiomatic vinext app feels like end to end.
npx vinext init scans your project for compatibility issues, installs the right dependencies, generates a Vite config, and adds vinext scripts alongside your existing Next.js setup. It's non-destructive — next dev keeps working.
Start with the vinext plugin, then add the adapter for your deployment target. Your routes, components, and Next.js configuration stay exactly where they are.
The smallest config for running a Next.js app through Vite.
Add the Cloudflare Vite plugin, Workers KV caching, and Cloudflare Images optimization.
Use Nitro when you want adapters for Node, Vercel, Netlify, AWS, and more.