cloudflare / vinext
Vite plugin that reimplements the Next.js API surface ā deploy anywhere
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing cloudflare/vinext in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewvinext The Next.js API surface, reimplemented on Vite. > **Read the announcement:** How we rebuilt Next.js with AI in one week > š§ **Experimental ā under heavy development.** This project is an experiment in AI-driven software development. The vast majority of the code, tests, and documentation were written by AI (Claude Code). Humans direct architecture, priorities, and design decisions, but have not reviewed most of the code line-by-line. Treat this accordingly ā there will be bugs, rough edges, and things that don't work. Use at your own risk. Quick start vinext includes an Agent Skill that handles migration for you. It works with Claude Code, OpenCode, Cursor, Codex, and dozens of other AI coding tools. Install it, open your Next.js project, and tell the AI to migrate: Then open your Next.js project in any supported tool and say: The skill handles compatibility checking, dependency installation, config generation, and dev server startup. It knows what vinext supports and will flag anything that needs manual attention. Or do it manually If you're using the App Router, also install: Replace with in your scripts: vinext auto-detects your or directory, loads , and configures Vite automatically. No required for basic usage. Your existing , , , and directories work as-is. Run first to scan for known compatibility issues, or use to automate the full migration. CLI reference | Command | Description | | --------------- | ----------------------------------------------------------------------- | | | Start dev server with HMR | | | Production build (multi-environment for App Router: RSC + SSR + client) | | | Start local production server for testing | | | Build and deploy to Cloudflare Workers | | | Migrate a Next.js project to run under vinext | | | Scan your Next.js app for compatibility issues before migrating | | | Delegate to eslint or oxlint | Options: , , (accepted, no-op). options: , , , , , . options: (default: 3001), , . Starting a new vinext project Run to create a new Next.js project, and then follow these instructions to migrate it to vinext. In the future, we will have a proper new project workflow. Migrating an existing Next.js project automates the migration in one command: This will: ⢠Run to scan for compatibility issues ⢠Install , , and App Router-only deps ( , ) as devDependencies ⢠Rename CJS config files (e.g. -> ) to avoid ESM conflicts ⢠Add to ⢠Add and scripts to ⢠Generate a minimal The migration is non-destructive -- your existing Next.js setup continues to work alongside vinext. It does not modify , , or any source files, and it does not remove Next.js dependencies. Use to overwrite an existing , or to skip the compatibility report. Why Vite has become the default build tool for modern web frameworks ā fast HMR, a clean plugin API, native ESM, and a growing ecosystem. With adding React Server Components support, it's now possible to build a full RSC framework on Vite. vinext is an experiment: can we reimplement the Next.js API surface on Vite, so that existing Next.js applications can run on a completely different toolchain? The answer, so far, is mostly yes ā about 94% of the API surface works. vinext works everywhere. It natively supports Cloudflare Workers (with , bindings, KV caching), and can be deployed to Vercel, Netlify, AWS, Deno Deploy, and more via the Nitro Vite plugin. Native support for additional platforms is planned. **Alternatives worth knowing about:** ⢠**OpenNext** ā adapts output for AWS, Cloudflare, and other platforms. OpenNext has been around much longer than vinext, is more mature, and covers more of the Next.js API surface because it builds on top of Next.js's own output rather than reimplementing it. If you want the safer, more proven option, start there. ⢠**Next.js self-hosting** ā Next.js can be deployed to any Node.js server, Docker container, or as a static export. Design principles ⢠**Deploy anywhere.** Natively supports Cloudflare Workers, with other platforms available via Nitro. Native adapters for more platforms are planned. ⢠**Pragmatic compatibility, not bug-for-bug parity.** Targets 95%+ of real-world Next.js apps. Edge cases that depend on undocumented Vercel behavior are intentionally not supported. ⢠**Latest Next.js only.** Targets Next.js 16.x. No support for deprecated APIs from older versions. ⢠**Incremental adoption.** Drop in the plugin, fix what breaks, deploy. FAQ **What is this?** vinext is a Vite plugin that reimplements the public Next.js API ā routing, server rendering, module imports, the CLI ā so you can run Next.js applications on Vite instead of the Next.js compiler toolchain. It can be deployed anywhere: Cloudflare Workers is the first natively supported target, with other platforms available via Nitro. Native adapters for more platforms are planned. **Is this a fork of Next.js?** No. vinext is an alternative implementation of the Next.js API surface built on Vite. It does import some Next.js types and utilities, but the core is written from scratch. The goal is not to create a competing framework or add features beyond what Next.js offers ā it's an experiment in how far AI-driven development and Vite's toolchain can go in replicating an existing, well-defined API surface. **How is this different from OpenNext?** OpenNext adapts the _output_ of a standard to run on various platforms. Because it builds on Next.js's own output, it inherits broad API coverage and has been well-tested for much longer. vinext takes a different approach: it reimplements the Next.js APIs on Vite from scratch, which means faster builds and smaller bundles, but less coverage of the long tail of Next.js features. If you need a mature, well-tested way to run Next.js outside Vercel, OpenNext is the safer choice. If you're interested in experimenting with a lighter toolchain and don't need every Next.js API, vinext might be worth a look. **Can I use this in production?** You can, with caution.ā¦