gitmyhub

vinext

TypeScript ★ 8.2k updated 7h ago

Vite plugin that reimplements the Next.js API surface — deploy anywhere

An experimental tool that lets you run an existing Next.js app on the Vite build engine and deploy it to Cloudflare Workers, without rewriting your pages or app directory structure.

TypeScriptNext.jsViteCloudflare Workerssetup: moderatecomplexity 3/5

Vinext is a tool that lets you take an existing Next.js web application — a site built with a popular framework for building websites — and run it using a different underlying build engine called Vite, without rewriting your code. Think of it like swapping the engine in a car: the body stays the same, but the engine is newer and faster.

The problem it solves: Next.js is tied to its own build system, which works well but locks you into Vercel's hosting infrastructure or requires manual workarounds for other platforms. Vinext reimplements the same features and file structure that Next.js developers expect, but runs them on Vite's engine — which has faster reloads during development and more flexibility about where you deploy.

How it works: you install the vinext package, swap a few lines in your project's scripts file, and your existing pages, app directory, and config files continue to work. Vinext auto-detects your project layout and configures itself. A built-in migration command (vinext init) does most of this automatically and runs a compatibility check first. The development server gives you live reloading (changes appear instantly), and a deploy command publishes directly to Cloudflare Workers — meaning your app runs close to users around the world rather than on a single server.

You would use vinext if you have a Next.js project and want to deploy it somewhere other than Vercel, especially Cloudflare Workers, without the complexity of manually adapting your build output. It's marked as experimental and primarily written by AI with human oversight, so it's suited for projects where you're comfortable with some rough edges. The full README is longer than what was provided.

Where it fits