vinext Quickstart
Get a Next.js project running on Vite + Cloudflare Workers with vinext.
Start from any Next.js app
vinext auto-detects app/ or pages/, loads next.config.js, and configures Vite automatically - no vite.config.ts required for basic usage.
Migrate an existing project
npx vinext init
init runs vinext check first (compatibility scan), then installs vite, @vitejs/plugin-react (plus @vitejs/plugin-rsc and react-server-dom-webpack for App Router), renames CJS configs to .cjs, adds "type": "module", adds dev:vinext / build:vinext scripts, and generates a minimal vite.config.ts. Nothing destructive: Next.js keeps working alongside.
Run both dev servers side by side:
npm run dev # Next.js, as before
npm run dev:vinext # vinext, port 3001
CLI reference
| Command | Purpose |
|---|---|
vinext dev | Dev server with HMR |
vinext build | Production build (App Router: RSC + SSR + client environments) |
vinext start | Local production server |
vinext deploy | Build and deploy to Cloudflare Workers |
vinext check | Compatibility scan before migrating |
vinext init | Automated non-destructive migration |
Useful deploy flags: --preview, --env <name>, --dry-run, --skip-build.
Deploy to Cloudflare Workers
vinext deploy
Native Workers support includes bindings and KV caching. Other platforms (Vercel, Netlify, AWS, Deno Deploy) go through the Nitro Vite plugin.
Gotcha: vinext targets Next.js 16.x only. Run
vinext checkbefore planning a migration of anything older; expect the ~6% API long tail (Vercel-internal behaviors) to surface as manual fixes.
Warning: vinext is experimental with mostly AI-written code. Cloudflare’s README says to treat it accordingly. Not for critical production paths without your own test coverage.
Alternatives
If the compatibility report shows heavy long-tail usage, use OpenNext (adapts real next build output, broader coverage, more mature) or consider a rewrite (React Router, SvelteKit, Astro).