cloudflare/vinextPublic

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

AI summary: Vite plugin that reimplements the Next.js API for deploying on Cloudflare Workers and other edge platforms.

Stars
9.4K
+12 today
Forks
480
Watchers
41
Open issues
329
Open PRs
401
Contributors
~141
Commits
2.8K
Branches
448

TypeScriptMITCreated Feb 24, 2026Last push 2d agoLatest release @cloudflare/[email protected]+35 stars this week+205 this month

Quick answers

What is vinext?
Vite plugin that reimplements the Next.js API for deploying on Cloudflare Workers and other edge platforms.
What does vinext do?
Vinext bridges the Next.js ecosystem with Vite to allow deployment on varied edge environments like Cloudflare Workers. Instead of wrapping Next.js builds, it actively reimplements the API surface including the App Router and React Server Components. It facilitates Server Actions, middleware, and route handlers natively within Vite's build pipeline. This allows developers to use familiar Next.js conventions while targeting lightweight runtime environments.
Who is vinext for?
Web developers and full-stack engineers looking to deploy React apps on edge infrastructure. Requires knowledge of Next.js and Vite ecosystems.
How do I get started with vinext?
npm install @vinext/plugin
How popular is vinext on GitHub?
cloudflare/vinext has 9,381 stars and 480 forks on GitHub, and gained 35 stars in the last 7 days.
What license does vinext use?
cloudflare/vinext is released under the MIT license.

Star history

since Jul 29, 2026
02.5K5K7.5KJul 2026Sep 2026Oct 2026Nov 2026
9.4K stars as of Nov 18, 2026. Measured daily since Jul 29, 2026; GitHub no longer exposes earlier star timestamps.

Update history

5 recorded

Contribution activity

commits per day, last 52 weeks
NovDecJanFebMarAprMayJunJulAugSepOctNovMonWedFri2025-11-23: 0 commits2025-11-24: 0 commits2025-11-25: 0 commits2025-11-26: 0 commits2025-11-27: 0 commits2025-11-28: 0 commits2025-11-29: 0 commits2025-11-30: 0 commits2025-12-01: 0 commits2025-12-02: 0 commits2025-12-03: 0 commits2025-12-04: 0 commits2025-12-05: 0 commits2025-12-06: 0 commits2025-12-07: 0 commits2025-12-08: 0 commits2025-12-09: 0 commits2025-12-10: 0 commits2025-12-11: 0 commits2025-12-12: 0 commits2025-12-13: 0 commits2025-12-14: 0 commits2025-12-15: 0 commits2025-12-16: 0 commits2025-12-17: 0 commits2025-12-18: 0 commits2025-12-19: 0 commits2025-12-20: 0 commits2025-12-21: 0 commits2025-12-22: 0 commits2025-12-23: 0 commits2025-12-24: 0 commits2025-12-25: 0 commits2025-12-26: 0 commits2025-12-27: 0 commits2025-12-28: 0 commits2025-12-29: 0 commits2025-12-30: 0 commits2025-12-31: 0 commits2026-01-01: 0 commits2026-01-02: 0 commits2026-01-03: 0 commits2026-01-04: 0 commits2026-01-05: 0 commits2026-01-06: 0 commits2026-01-07: 0 commits2026-01-08: 0 commits2026-01-09: 0 commits2026-01-10: 0 commits2026-01-11: 0 commits2026-01-12: 0 commits2026-01-13: 0 commits2026-01-14: 0 commits2026-01-15: 0 commits2026-01-16: 0 commits2026-01-17: 0 commits2026-01-18: 0 commits2026-01-19: 0 commits2026-01-20: 0 commits2026-01-21: 0 commits2026-01-22: 0 commits2026-01-23: 0 commits2026-01-24: 0 commits2026-01-25: 0 commits2026-01-26: 0 commits2026-01-27: 0 commits2026-01-28: 0 commits2026-01-29: 0 commits2026-01-30: 0 commits2026-01-31: 0 commits2026-02-01: 0 commits2026-02-02: 0 commits2026-02-03: 0 commits2026-02-04: 0 commits2026-02-05: 0 commits2026-02-06: 0 commits2026-02-07: 0 commits2026-02-08: 0 commits2026-02-09: 0 commits2026-02-10: 0 commits2026-02-11: 0 commits2026-02-12: 0 commits2026-02-13: 0 commits2026-02-14: 0 commits2026-02-15: 0 commits2026-02-16: 0 commits2026-02-17: 0 commits2026-02-18: 0 commits2026-02-19: 0 commits2026-02-20: 0 commits2026-02-21: 0 commits2026-02-22: 0 commits2026-02-23: 1 commit2026-02-24: 20 commits2026-02-25: 25 commits2026-02-26: 13 commits2026-02-27: 21 commits2026-02-28: 8 commits2026-03-01: 6 commits2026-03-02: 3 commits2026-03-03: 8 commits2026-03-04: 5 commits2026-03-05: 17 commits2026-03-06: 19 commits2026-03-07: 22 commits2026-03-08: 24 commits2026-03-09: 25 commits2026-03-10: 30 commits2026-03-11: 22 commits2026-03-12: 24 commits2026-03-13: 23 commits2026-03-14: 3 commits2026-03-15: 6 commits2026-03-16: 13 commits2026-03-17: 8 commits2026-03-18: 3 commits2026-03-19: 11 commits2026-03-20: 6 commits2026-03-21: 21 commits2026-03-22: 4 commits2026-03-23: 7 commits2026-03-24: 3 commits2026-03-25: 1 commit2026-03-26: 4 commits2026-03-27: 4 commits2026-03-28: 13 commits2026-03-29: 10 commits2026-03-30: 4 commits2026-03-31: 3 commits2026-04-01: 2 commits2026-04-02: 5 commits2026-04-03: 13 commits2026-04-04: 1 commit2026-04-05: 8 commits2026-04-06: 0 commits2026-04-07: 1 commit2026-04-08: 8 commits2026-04-09: 4 commits2026-04-10: 5 commits2026-04-11: 4 commits2026-04-12: 6 commits2026-04-13: 9 commits2026-04-14: 3 commits2026-04-15: 4 commits2026-04-16: 1 commit2026-04-17: 3 commits2026-04-18: 0 commits2026-04-19: 0 commits2026-04-20: 3 commits2026-04-21: 2 commits2026-04-22: 4 commits2026-04-23: 2 commits2026-04-24: 7 commits2026-04-25: 5 commits2026-04-26: 8 commits2026-04-27: 7 commits2026-04-28: 15 commits2026-04-29: 22 commits2026-04-30: 14 commits2026-05-01: 7 commits2026-05-02: 14 commits2026-05-03: 14 commits2026-05-04: 8 commits2026-05-05: 26 commits2026-05-06: 25 commits2026-05-07: 18 commits2026-05-08: 3 commits2026-05-09: 7 commits2026-05-10: 0 commits2026-05-11: 8 commits2026-05-12: 18 commits2026-05-13: 7 commits2026-05-14: 20 commits2026-05-15: 20 commits2026-05-16: 14 commits2026-05-17: 21 commits2026-05-18: 27 commits2026-05-19: 4 commits2026-05-20: 10 commits2026-05-21: 31 commits2026-05-22: 29 commits2026-05-23: 1 commit2026-05-24: 0 commits2026-05-25: 0 commits2026-05-26: 21 commits2026-05-27: 15 commits2026-05-28: 44 commits2026-05-29: 8 commits2026-05-30: 3 commits2026-05-31: 6 commits2026-06-01: 12 commits2026-06-02: 2 commits2026-06-03: 15 commits2026-06-04: 4 commits2026-06-05: 24 commits2026-06-06: 14 commits2026-06-07: 16 commits2026-06-08: 34 commits2026-06-09: 14 commits2026-06-10: 5 commits2026-06-11: 20 commits2026-06-12: 25 commits2026-06-13: 15 commits2026-06-14: 10 commits2026-06-15: 27 commits2026-06-16: 13 commits2026-06-17: 10 commits2026-06-18: 35 commits2026-06-19: 21 commits2026-06-20: 27 commits2026-06-21: 1 commit2026-06-22: 16 commits2026-06-23: 31 commits2026-06-24: 15 commits2026-06-25: 0 commits2026-06-26: 30 commits2026-06-27: 1 commit2026-06-28: 5 commits2026-06-29: 27 commits2026-06-30: 21 commits2026-07-01: 17 commits2026-07-02: 13 commits2026-07-03: 13 commits2026-07-04: 15 commits2026-07-05: 0 commits2026-07-06: 7 commits2026-07-07: 2 commits2026-07-08: 4 commits2026-07-09: 8 commits2026-07-10: 4 commits2026-07-11: 0 commits2026-07-12: 0 commits2026-07-13: 0 commits2026-07-14: 12 commits2026-07-15: 11 commits2026-07-16: 5 commits2026-07-17: 5 commits2026-07-18: 1 commit2026-07-19: 0 commits2026-07-20: 6 commits2026-07-21: 16 commits2026-07-22: 11 commits2026-07-23: 7 commits2026-07-24: 5 commits2026-07-25: 0 commits2026-07-26: 0 commits2026-07-27: 8 commits2026-07-28: 5 commits2026-07-29: 8 commits2026-07-30: 3 commits2026-07-31: 9 commits2026-08-01: 3 commits2026-08-02: 0 commits2026-08-03: 19 commits2026-08-04: 2 commits2026-08-05: 1 commit2026-08-06: 1 commit2026-08-07: 8 commits2026-08-08: 1 commit2026-08-09: 0 commits2026-08-10: 12 commits2026-08-11: 5 commits2026-08-12: 4 commits2026-08-13: 9 commits2026-08-14: 3 commits2026-08-15: 9 commits2026-08-16: 5 commits2026-08-17: 6 commits2026-08-18: 25 commits2026-08-19: 7 commits2026-08-20: 3 commits2026-08-21: 0 commits2026-08-22: 0 commits2026-08-23: 0 commits2026-08-24: 11 commits2026-08-25: 2 commits2026-08-26: 2 commits2026-08-27: 3 commits2026-08-28: 0 commits2026-08-29: 0 commits2026-08-30: 0 commits2026-08-31: 0 commits2026-09-01: 12 commits2026-09-02: 5 commits2026-09-03: 3 commits2026-09-04: 0 commits2026-09-05: 0 commits2026-09-06: 0 commits2026-09-07: 19 commits2026-09-08: 2 commits2026-09-09: 7 commits2026-09-10: 0 commits2026-09-11: 1 commit2026-09-12: 0 commits2026-09-13: 0 commits2026-09-14: 16 commits2026-09-15: 7 commits2026-09-16: 2 commits2026-09-17: 7 commits2026-09-18: 0 commits2026-09-19: 0 commits2026-09-20: 5 commits2026-09-21: 41 commits2026-09-22: 24 commits2026-09-23: 3 commits2026-09-24: 7 commits2026-09-25: 4 commits2026-09-26: 3 commits2026-09-27: 24 commits2026-09-28: 43 commits2026-09-29: 24 commits2026-09-30: 21 commits2026-10-01: 9 commits2026-10-02: 0 commits2026-10-03: 0 commits2026-10-04: 0 commits2026-10-05: 5 commits2026-10-06: 15 commits2026-10-07: 16 commits2026-10-08: 22 commits2026-10-09: 22 commits2026-10-10: 14 commits2026-10-11: 18 commits2026-10-12: 26 commits2026-10-13: 27 commits2026-10-14: 36 commits2026-10-15: 15 commits2026-10-16: 17 commits2026-10-17: 4 commits2026-10-18: 10 commits2026-10-19: 18 commits2026-10-20: 19 commits2026-10-21: 9 commits2026-10-22: 29 commits2026-10-23: 22 commits2026-10-24: 18 commits2026-10-25: 17 commits2026-10-26: 26 commits2026-10-27: 34 commits2026-10-28: 7 commits2026-10-29: 1 commit2026-10-30: 5 commits2026-10-31: 10 commits2026-11-01: 19 commits2026-11-02: 31 commits2026-11-03: 31 commits2026-11-04: 12 commits2026-11-05: 1 commit2026-11-06: 4 commits2026-11-07: 2 commits2026-11-08: 0 commits2026-11-09: 28 commits2026-11-10: 4 commits2026-11-11: 1 commit2026-11-12: 14 commits2026-11-13: 4 commits2026-11-14: 3 commits2026-11-15: 0 commits2026-11-16: 5 commits2026-11-17: 10 commits2026-11-18: 4 commits2026-11-19: 0 commits2026-11-20: 0 commits2026-11-21: 0 commits
2,785 commits in the last yearLessMore

Signals and awards

derived from tracked data
  • Very active

    2,785 commits in 52 weeks

  • Community-driven

    ~141 contributors

  • Permissive license

    MIT

  • Continuous integration

    Automated checks passing

What vinext does

Vinext bridges the Next.js ecosystem with Vite to allow deployment on varied edge environments like Cloudflare Workers. Instead of wrapping Next.js builds, it actively reimplements the API surface including the App Router and React Server Components. It facilitates Server Actions, middleware, and route handlers natively within Vite's build pipeline. This allows developers to use familiar Next.js conventions while targeting lightweight runtime environments.

Web developers and full-stack engineers looking to deploy React apps on edge infrastructure. Requires knowledge of Next.js and Vite ecosystems.

  • Next.js API Reimplementation: Provides core Next.js features like the App Router directly in Vite.
  • Edge Deployment: Integrates deeply with Cloudflare Workers for edge-first distribution.
  • Server Components Support: Native compatibility with React Server Components and Server Actions.
  • Middleware Integration: Allows custom routing and request handling using standard middleware.
  • Static Exporting: Generates fully static output for standard CDN deployments alongside dynamic rendering.

Where teams use it

Edge Migration

Migrate existing Next.js applications to Cloudflare Workers for reduced latency.

Vite Tooling

Leverage Vite's rapid build system while keeping Next.js routing patterns.

Server Actions

Implement secure server-side logic tightly coupled with frontend components.

Hybrid Rendering

Mix static site generation with edge-rendered dynamic paths effortlessly.

Getting started: npm install @vinext/plugin

README

main branch

vinext

Run Next.js applications on Vite, with Cloudflare Workers as the primary deployment target.

Website: vinext.dev

Documentation: vinext.dev/docs

Read the announcement: How we rebuilt Next.js with AI in one week

Under active development. vinext supports substantial Next.js applications today, but it is not yet a drop-in replacement for every application or production workload. Expect compatibility gaps, especially in newer App Router features, and evaluate it against your own application before adopting it.

vinext reimplements the Next.js API surface on Vite rather than consuming next build output. It supports both the App Router and Pages Router, React Server Components, Server Actions, middleware, route handlers, ISR, static export, and the most commonly used next/* modules. Cloudflare Workers has the deepest integration; Node.js and other platforms are available with different levels of support.

Project status

What works today

  • App Router and Pages Router in development and production builds
  • React Server Components, Server Actions, route handlers, and middleware
  • Static generation, ISR, output: "export", and standalone Node.js output
  • Core Next.js APIs and modules, including next/link, next/image, next/navigation, next/headers, next/cache, and the Metadata API
  • Cloudflare Workers deployment with bindings, cache adapters, and image optimization support
  • Migration tooling through vinext check, vinext init, and the vinext Agent Skill

Known gaps we're working on

These are active compatibility areas, not permanent exclusions:

  • Cache Components and Partial Prerendering: "use cache" is partially implemented, but full cacheComponents behavior is still incomplete. Cache profiles, tags, partial shells, resume behavior, prefetching, and some dev/build cache semantics do not yet match Next.js in every case.
  • Build-time image and font optimization: images can be optimized at request time on Cloudflare, but vinext does not yet reproduce Next.js's complete build-time image pipeline. Google Fonts are loaded from the CDN, and local font CSS is injected at runtime rather than extracted during the build.
  • Native modules in App Router development: packages such as sharp, resvg, satori, lightningcss, and @napi-rs/canvas can fail in Vite's RSC development environment. Production builds support more of these cases than development mode.
  • Platform-specific and advanced Next.js behavior: preferredRegion route config is ignored, and runtime doesn't choose where a route runs (outside cacheComponents, a runtime = "edge" App Router page is never ISR-cached, as in Next.js), and some recently introduced or undocumented Next.js behavior may not yet be reproduced.

Run vinext check against an existing application before migrating. If a gap is not listed here, check the open issues or file a focused reproduction.

Quick start

Use the official setup commands below. They are the recommended way to create or migrate a vinext project because they configure dependencies, scripts, Vite, and your deployment target for you.

Start a new project with create-vinext-app:

pnpm create vinext-app@latest my-app

Migrate an existing Next.js project with vinext init:

npx vinext init

Optional: migrate with an AI agent

Prefer vinext init for a direct, repeatable migration. If you want an AI agent to investigate compatibility issues and guide the migration, vinext also includes an optional Agent Skill. It works with Claude Code, OpenCode, Cursor, Codex, and dozens of other AI coding tools:

npx skills add cloudflare/vinext

Then open your Next.js project in any supported tool and say:

migrate this project to vinext

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

npm install vinext
npm install -D vite @vitejs/plugin-react

If you're using the App Router, also install:

npm install react-server-dom-webpack
npm install -D @vitejs/plugin-rsc

Add a Vite config:

import { defineConfig } from "vite";
import vinext from "vinext";

export default defineConfig({
  plugins: [vinext()],
});

Then use Vite for development and builds:

{
  "scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "start": "vinext start"
  }
}
npx vite dev        # Development server with HMR
npx vite build      # Production build
npx @vinext/cloudflare deploy  # Build and deploy to Cloudflare Workers

With Vite+, use vpx @vinext/cloudflare deploy, or vp exec vinext-cloudflare deploy when running the locally installed bin.

The vinext() plugin auto-detects your app/ or pages/ directory and loads next.config.js.

Your existing pages/, app/, next.config.js, and public/ directories work as-is. Run vinext check first to scan for known compatibility issues, or use vinext init to automate the full migration.

CLI reference

Command Description
vite dev Start dev server with HMR
vite build Production build (multi-environment for App Router: RSC + SSR + client)
vinext start Start local production server for testing
npx @vinext/cloudflare deploy Build and deploy to Cloudflare Workers
vp exec vinext-cloudflare deploy Build and deploy to Cloudflare Workers with Vite+
vinext init Migrate a Next.js project to run under vinext
vinext check Scan your Next.js app for compatibility issues before migrating
vinext lint Delegate to eslint or oxlint

vinext dev and vinext build remain as thin aliases for the project-local Vite commands. They require a Vite config; if one is missing, run vinext init. Vite owns their options, output, and exit behavior. For older configured projects, the aliases still preload dotenv before Vite evaluates the config and add "type": "module" (renaming known CommonJS config files to .cjs) when an unambiguous default Vite config requires the ESM migration. An explicit "type": "commonjs" is never changed. Direct vite dev and vite build do not perform these wrapper compatibility steps.

@vinext/cloudflare deploy options: --preview, --env <name>, --name <name> (Wrangler config projects only), --vite-config <path>, --message <text>, --tag <text>, --skip-build, --dry-run, --warm-cache, --traffic-aware-warm-cache.

vinext init prompts for a deployment target, defaulting to Cloudflare. Agents must ask the user which target they want, then pass --platform=cloudflare or --platform=node. For Cloudflare, agents and CI must also pass --cdn-cache, --data-cache, and --image-optimization; see Run init without prompts.

Other options: --port <port> (default: 3001), --skip-check, --force.

Cloudflare init uses cf and cloudflare.config.ts by default. Both vinext init and create-vinext-app accept --legacy-wrangler-cloudflare-init to retain the legacy Wrangler setup. Existing Wrangler configs are not automatically migrated. If a root Wrangler config belongs to another Worker, vinext init --ignore-wrangler-config sets up cloudflare.config.ts and leaves that file untouched. vinext init --name <name> sets the Worker name in the generated config instead of deriving it from package.json. An existing config keeps its own Worker name, and init prints a warning.

If your next.config.* sets output: "standalone", vite build emits a self-hosting bundle at dist/standalone/. Start it with:

node dist/standalone/server.js

Environment variables: PORT (default 3000), HOST (default 0.0.0.0).

Note: Next.js standalone uses HOSTNAME for the bind address, but vinext uses HOST to avoid collision with the system-set HOSTNAME variable on Linux. Update your deployment config accordingly.

Custom standalone entries

The generated server.js is a small wrapper around startProdServer from vinext/server/prod-server. To control where the server loads the build output from, write your own entry and call startProdServer directly. All options are optional:

Option Default Description
port PORT env var, otherwise 3000 Port to listen on.
host "0.0.0.0" Address to bind to. Unlike the generated server.js, startProdServer doesn't read HOST, so pass process.env.HOST yourself if you need it.
outDir dist, resolved against the current directory Build output directory containing client/ and server/. Relative paths resolve against the current directory. In standalone output, this is dist/standalone/dist.
serverDir <outDir>/server Directory containing the server bundles, manifests, and prerendered output.
rscEntryPath <serverDir>/index.js App Router server entry. If this file exists, the server runs in App Router mode.
serverEntryPath <serverDir>/entry.js Pages Router server entry. Used when there's no App Router entry.
noCompression false Disable response compression.

ProdServerOptions also has purpose and silent, which vinext uses for its own build-time servers. Leave them unset. The returned promise resolves to { server, port } once the server is listening.

Compiled single-file binaries. A bun build --compile binary can't use the generated server.js. Bun fixes import.meta.dirname when it compiles the binary, so join(import.meta.dirname, "dist") doesn't point at the directory the binary runs from. Depending on the Bun version, it points at the build machine's path or at Bun's embedded /$bunfs/root. Resolve outDir from the executable's location instead:

// server-bin.mjs, in your project root
import path from "node:path";
import { startProdServer } from "vinext/server/prod-server";

await startProdServer({
  port: Number.parseInt(process.env.PORT ?? "3000", 10),
  host: process.env.HOST ?? "0.0.0.0",
  outDir: path.join(path.dirname(process.execPath), "dist"),
});
bun build --compile --compile-autoload-package-json server-bin.mjs --outfile dist/standalone/server

Keep the entry outside dist/standalone: each build deletes and recreates that directory. Compile after vite build, then ship the whole dist/standalone directory, because the server binary needs the dist/ and node_modules/ directories next to it. The server bundles in dist/server still import their dependencies from node_modules at runtime. --compile-autoload-package-json lets the binary read package exports and main fields when it resolves them. Under plain Node, process.execPath is the Node binary, so use this entry only for compiled builds.

Starting a new vinext project

Use create-vinext-app for new projects. It creates a TypeScript App Router project with Tailwind CSS and then runs the same vinext init setup used for existing apps:

pnpm create vinext-app@latest my-app

The generated project is Cloudflare Workers-ready by default. Pass --platform=node if you want the Node target instead.

Migrating an existing Next.js project

vinext init automates the migration in one command:

npx vinext init

This will:

  1. Run vinext check to scan for compatibility issues
  2. Install vinext runtime packages as dependencies and Vite/plugin tooling as devDependencies
  3. Rename CJS config files (e.g. postcss.config.js -> .cjs) to avoid ESM conflicts
  4. Add "type": "module" to package.json
  5. Add dev:vinext, build:vinext, and start:vinext scripts to package.json
  6. Prompt for a deployment platform (Cloudflare by default, or Node)
  7. Generate the matching vite.config.ts
  8. For Cloudflare, generate cloudflare.config.ts for cf and Cloudflare Vite plugin v2

The migration is non-destructive -- your existing Next.js setup continues to work alongside vinext. It does not modify next.config, tsconfig.json, or any source files, and it does not remove Next.js dependencies.

vinext targets Vite 8, which defaults to Rolldown, Oxc, Lightning CSS, and a newer browser baseline. If you bring custom Vite config or plugins from an older setup, prefer oxc, optimizeDeps.rolldownOptions, and build.rolldownOptions over older esbuild and build.rollupOptions knobs, and override build.target if you still need older browsers. If a dependency breaks because of stricter CommonJS default import handling, fix the import or use legacy.inconsistentCjsInterop: true as a temporary escape hatch. See the Vite 8 migration guide.

Production client JS, Web Worker and CSS files use hash-only file names (by default _next/static/chunks/[hash].js, _next/static/workers/<module-id>-[hash].js and _next/static/css/[hash].css) so component and source file names don't appear in public asset URLs. Web Worker file names are fixed. To use different client JS and CSS names, set entryFileNames, chunkFileNames or assetFileNames in build.rolldownOptions.output (or environments.client.build.rolldownOptions.output), keeping them under the client assets directory: _next/static/ by default, or <prefix>/_next/static/ with a path-based assetPrefix such as /cdn (e.g. chunkFileNames: "cdn/_next/static/chunks/[name]-[hash].js").

npm run dev:vinext    # Start the vinext dev server (port 3001)
npm run build:vinext  # Build production output with vinext
npm run start:vinext  # Start vinext production server
npm run dev           # Still runs Next.js as before

Use --platform=cloudflare or --platform=node to skip the platform prompt. Cloudflare init updates an existing JavaScript or TypeScript Vite config using its AST, preserving unrelated settings. Use --force to replace an existing Node-target Vite config, or --skip-check 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 @vitejs/plugin-rsc adding React Server Components support, it's now possible to build a full RSC framework on Vite.

vinext reimplements the Next.js API surface on Vite so existing Next.js applications can run on a different toolchain. The answer, so far, is that substantial applications can.

vinext works everywhere. It natively supports Cloudflare Workers (with npx @vinext/cloudflare deploy or vp exec vinext-cloudflare deploy, 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 next build 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, next/* 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. The core is written from scratch. The goal is not to create a competing framework or add features beyond what Next.js offers; it is to provide the same well-defined API surface on Vite's toolchain.

Does vinext require Next.js to be installed? No. vinext ships fallback declarations for the supported next and next/* APIs, so applications can run and type-check without the next package. If both packages are installed, vinext keeps using Next.js's authoritative types and adds only its own extensions. Compatibility features that consume Next.js internals, such as styled-jsx, may still require a matching Next.js installation when used.

How is this different from OpenNext? OpenNext adapts the output of a standard next build 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 want a lighter Vite-based toolchain and do not need every Next.js API, vinext may be a good fit. To move an OpenNext app on Cloudflare Workers to vinext, see Migrate from OpenNext.

Can I use this in production? You can, with caution. vinext has known compatibility gaps and has not yet been battle-tested across the full range of production Next.js workloads. Evaluate the features and deployment target your application relies on before adopting it.

Can I just self-host Next.js? Yes. Next.js supports self-hosting on Node.js servers, Docker containers, and static exports. If you're happy with the Next.js toolchain and just want to run it somewhere other than Vercel, self-hosting is the simplest path.

How are you verifying this works? The test suite has over 1,700 Vitest tests and 380 Playwright E2E tests. This includes tests ported directly from the Next.js test suite and OpenNext's Cloudflare conformance suite, covering routing, SSR, RSC, server actions, caching, metadata, middleware, streaming, and more. Vercel's App Router Playground also runs on vinext as an integration test. See the Tests section for details.

Who is reviewing this code? A mix of humans and AI agents. Humans review PRs before they merge, focused on behavior, structure, and long-term direction. We lean heavily on agent-driven code review to catch issues at PR time and across the codebase. The test suite is the primary quality gate. Outside contributions and deeper human code review are very welcome.

Why Vite? Vite is an excellent build tool with a rich plugin ecosystem, first-class ESM support, and fast HMR. The @vitejs/plugin-rsc plugin adds React Server Components support with multi-environment builds. vinext builds the Next.js developer experience on top of that infrastructure.

Does this support the Pages Router, App Router, or both? Both. File-system routing, SSR, client hydration, and deployment to Cloudflare Workers work for both routers.

What version of Next.js does this target? Next.js 16.x. No support for deprecated APIs from older versions.

Can I deploy to AWS/Netlify/other platforms? Yes. Add the Nitro Vite plugin alongside vinext, and you can deploy to Vercel, Netlify, AWS Amplify, Deno Deploy, Azure, and many more. See Other platforms (via Nitro) for setup. For Cloudflare Workers, the native integration (npx @vinext/cloudflare deploy or vp exec vinext-cloudflare deploy) gives you the smoothest experience. Native adapters for more platforms are planned.

What happens when Next.js releases a new feature? We track the public Next.js API surface and add support for new stable features. Experimental or unstable Next.js features are lower priority. The plan is to add commit-level tracking of the Next.js repo so we can stay current as new versions are released.

Deployment

Cloudflare Workers

vinext has native integration with Cloudflare Workers through @cloudflare/vite-plugin, including bindings access via cloudflare:workers, KV caching, image optimization, and the @vinext/cloudflare deploy one-command workflow.

Prerequisites

Before running npx @vinext/cloudflare deploy for the first time, run vinext init --platform=cloudflare to install cf and Cloudflare Vite plugin v2, create or update vite.config.*, and generate cloudflare.config.ts.

Authentication — pick one:

  • cf auth login (recommended for local development) — opens a browser window to authenticate.
  • CLOUDFLARE_API_TOKEN env var (CI / non-interactive) — create a token at dash.cloudflare.com/profile/api-tokens using the Edit Cloudflare Workers template. That template grants all the permissions @vinext/cloudflare deploy needs.

Account ID:

Set accountId at the top level of defineConfig in cloudflare.config.ts, outside worker. Find your account ID in the Cloudflare dashboard URL (dash.cloudflare.com/<account-id>).

Alternatively, set the CLOUDFLARE_ACCOUNT_ID environment variable instead of hardcoding it in the config file.

@vinext/cloudflare deploy validates the initialized setup, builds the application, and deploys its Cloudflare Build Output with cf without rewriting project configuration.

Cloudflare init can also configure image optimization declaratively in the Vite config with imagesOptimizer() and add the matching Images binding to cloudflare.config.ts. The built-in fetch handlers register that optimizer at runtime; image optimization is not implemented or generated by @vinext/cloudflare deploy.

npx @vinext/cloudflare deploy
vp exec vinext-cloudflare deploy
npx @vinext/cloudflare deploy --env staging
vp exec vinext-cloudflare deploy --env staging

Use --env <name> to select the Vite mode for the build and deployment. --preview is shorthand for --env preview.

In Response Store service-binding mode, both Workers build together, but the cache Worker is deployed explicitly. After creating the R2 bucket named by init, run:

pnpm run build:vinext
pnpm run deploy:response-store
pnpm run deploy:vinext

For create-vinext-app projects, use build and deploy instead of build:vinext and deploy:vinext. Redeploy the Response Store only when its package or config changes; normal application deployments do not deploy auxiliary Workers.

To deploy from a connected Git repository, replace the default Wrangler commands in Workers Builds; see Deploy with Workers Builds.

The init command also auto-detects and fixes common migration issues:

  • Adds "type": "module" to package.json if missing
  • Resolves tsconfig.json path aliases automatically with Vite's native resolver
  • Detects MDX usage and configures @mdx-js/rollup
  • Renames CJS config files (postcss.config.js, etc.) to .cjs when needed

vinext does not stub native Node.js modules such as sharp, @resvg/resvg-js or @napi-rs/canvas. Workers cannot load Node-API addons, so importing one into Worker code fails the build or the request. If a dependency imports one on a code path that never runs on Workers, alias it to a module of your own with resolve.alias in vite.config.ts. Configs generated by earlier versions of vinext init may contain resolve.alias entries pointing at empty-stub.js, a file init never created; delete them.

Both App Router and Pages Router work on Workers with full client-side hydration.

Cloudflare Bindings (D1, R2, KV, AI, etc.)

Use import { env } from "cloudflare:workers" to access bindings in any server component, route handler, or server action. No custom worker entry or special configuration required.

import { env } from "cloudflare:workers";

export default async function Page() {
  const result = await env.DB.prepare("SELECT * FROM posts").all();
  return <div>{JSON.stringify(result)}</div>;
}

This works because @cloudflare/vite-plugin runs the RSC environment in workerd, where cloudflare:workers is a native module. In production builds, the import is externalized so workerd resolves it at runtime. All binding types are supported: D1, R2, KV, Durable Objects, AI, Queues, Vectorize, Browser Rendering, etc.

Add bindings to your Worker's env in cloudflare.config.ts:

import { bindings } from "cf/config";

env: {
  // ...existing bindings
  DB: bindings.d1({ name: "my-db" }),
  CACHE: bindings.kv(),
},

Binding and runtime types are generated in .cloudflare/types during dev and build. Include that directory in tsconfig.json; run cf workers types before standalone type-checks. Generated types and Build Output stay gitignored.

Note: You do not need getPlatformProxy(), a custom worker entry with fetch(request, env), or any other workaround. cloudflare:workers is the recommended way to access bindings in vinext.

Traffic-aware pre-warming

Traffic-aware warming queries Cloudflare zone analytics at deploy time to select the routes that actually get traffic. Those routes then go through vinext's standard staged CDN pre-warming flow, including route resolution, cacheability checks, and promotion.

npx @vinext/cloudflare deploy --traffic-aware-warm-cache                              # Pre-warm routes covering 90% of traffic
vp exec vinext-cloudflare deploy --traffic-aware-warm-cache                           # Same, with Vite+
npx @vinext/cloudflare deploy --traffic-aware-warm-cache --traffic-aware-coverage 95  # More aggressive coverage
npx @vinext/cloudflare deploy --traffic-aware-warm-cache --traffic-aware-limit 500    # Cap at 500 routes
npx @vinext/cloudflare deploy --traffic-aware-warm-cache --traffic-aware-window 48    # Use 48h of analytics
npx @vinext/cloudflare deploy --traffic-aware-warm-cache --warm-cache-target https://example.com  # Set the production origin manually

Requires a custom domain (zone analytics are unavailable on *.workers.dev) and CLOUDFLARE_API_TOKEN with Zone > Analytics > Read and Zone > Zone > Read permissions for that zone.

For typed config projects, declare the custom domain with domains: ["example.com"] on the Worker in cloudflare.config.ts. The first domain in the generated Build Output is used for both analytics and staged warming. Wrangler projects retain domain selection from their configured routes and deployed triggers. Use --warm-cache-target https://example.com to override the origin. Add --warm-cache-certify to require reusable cache hits before promotion, or --no-promote to leave the warmed version at 0% traffic for verification.

Use the traffic-aware flag on its own to apply the coverage and route limits. Combining it with --warm-cache retains full build-discovered warming. See the caching guide for all selection controls and requirements.

The previous --experimental-traffic-aware-warm-cache, --experimental-tpr, and --tpr-* names remain supported as aliases.

Custom Vite configuration

If you need to customize the Vite config, create a vite.config.ts. vinext will merge its config with yours. For Cloudflare Workers deployment with the App Router, configure @cloudflare/vite-plugin so the RSC environment runs in workerd:

import { defineConfig } from "vite";
import vinext from "vinext";
import { cloudflare } from "@cloudflare/vite-plugin";

export default defineConfig({
  plugins: [
    vinext(),
    cloudflare({
      viteEnvironment: { name: "rsc", childEnvironments: ["ssr"] },
    }),
  ],
});

Do not register @vitejs/plugin-rsc yourself. It is an optional peer dependency, so it must be installed in your project, but vinext auto-registers it whenever an app/ directory is detected. Adding an explicit rsc() call fails the build with [vinext] Duplicate @vitejs/plugin-rsc detected. Pass rsc: false to vinext() only if you want to own that registration.

Module Federation (client-side)

Use @module-federation/vinext, a thin wrapper around @module-federation/vite with vinext defaults. Register federation() before vinext():

npm install @module-federation/vinext
import { federation } from "@module-federation/vinext";
import { defineConfig } from "vite";
import vinext from "vinext";

export default defineConfig({
  plugins: [
    federation({
      name: "host",
      remotes: {
        catalog: {
          type: "module",
          name: "catalog",
          entry: "https://catalog.example.com/remoteEntry.js",
          entryGlobalName: "catalog",
          shareScope: "default",
        },
      },
    }),
    vinext(),
  ],
});

The wrapper shares react and react-dom as singletons, defaults filename to remoteEntry.js, and injects the host's federation startup into the entry, because vinext has no conventional HTML entry. Explicit options override these defaults, and every @module-federation/vite option remains available. Passing your own shared replaces the default map, so keep react, react/, react-dom, and react-dom/ as singletons in it, in both the host and remotes.

In a remote client component, use getVinextReact() before reading React hooks. vinext registers the host's browser React instance before application modules execute, and the first registration remains stable across remote evaluation and HMR:

"use client";

import * as React from "react";
import { getVinextReact } from "vinext/client";

const { useState } = getVinextReact(React);

export function RemoteCounter() {
  const [count, setCount] = useState(0);
  return <button onClick={() => setCount((value) => value + 1)}>{count}</button>;
}

This bridge is browser-only. It does not provide App Router Module Federation SSR or transparently replace React imports inside third-party packages; compatible React versions remain the responsibility of the Module Federation shared configuration.

See the Module Federation guide for loading remote components in the host.

Other platforms (via Nitro)

For deploying to platforms other than Cloudflare, vinext works with Nitro as a Vite plugin. Add nitro alongside vinext in your Vite config and deploy to any Nitro-supported platform.

import { defineConfig } from "vite";
import vinext from "vinext";
import { nitro } from "nitro/vite";

export default defineConfig({
  plugins: [vinext(), nitro()],
});
npm install nitro

Nitro auto-detects the deployment platform in most CI/CD environments (Vercel, Netlify, AWS Amplify, Azure, and others), so you typically don't need to set a preset. For local builds, set the NITRO_PRESET environment variable:

NITRO_PRESET=vercel npx vite build
NITRO_PRESET=netlify npx vite build
NITRO_PRESET=deno_deploy npx vite build

Deploying to Cloudflare? You can use Nitro, but the native integration (npx @vinext/cloudflare deploy, vp exec vinext-cloudflare deploy, and @cloudflare/vite-plugin) is recommended. It provides the best developer experience with cloudflare:workers bindings, KV caching, image optimization, and one-command deploys.

Vercel

Nitro auto-detects Vercel in CI. For local builds:

NITRO_PRESET=vercel npx vite build

Deploy with the Vercel CLI or connect your Git repo in the Vercel dashboard. Set the build command to vite build and the output directory to .output.

Netlify

Nitro auto-detects Netlify in CI. For local builds:

NITRO_PRESET=netlify npx vite build

Deploy with the Netlify CLI or connect your Git repo. Set the build command to vite build.

AWS (Amplify)

Nitro auto-detects AWS Amplify in CI. For local builds:

NITRO_PRESET=aws_amplify npx vite build

Connect your Git repo in the AWS Amplify console. Set the build command to vite build.

Deno Deploy
NITRO_PRESET=deno_deploy npx vite build
cd .output
deployctl deploy --project=my-project server/index.ts
Node.js server
NITRO_PRESET=node npx vite build
node .output/server/index.mjs

This produces a standalone Node.js server. Suitable for Docker, VMs, or any environment that can run Node.

See the Nitro deployment docs for the full list of supported platforms and provider-specific configuration.

Live examples

These are deployed to Cloudflare Workers and updated on every push to main:

Example Description URL
App Router Playground Vercel's Next.js App Router Playground running on vinext app-router-playground.vinext.workers.dev
Hacker News HN clone (App Router, RSC) hackernews.vinext.workers.dev
Nextra Docs Nextra docs site (MDX, App Router) nextra-docs-template.vinext.workers.dev
App Router (minimal) Minimal App Router on Workers app-router-cloudflare.vinext.workers.dev
Pages Router (minimal) Minimal Pages Router on Workers pages-router-cloudflare.vinext.workers.dev
Static export Hybrid App/Pages Router site served as assets only static-export.vinext.workers.dev
RealWorld API REST API routes example realworld-api-rest.vinext.workers.dev
Benchmarks Dashboard Build performance tracking over time (D1-backed) vinext.dev/benchmarks
App Router + Nitro App Router deployed via Nitro (multi-platform) examples/app-router-nitro

API coverage

~94% of the Next.js 16 API surface has full or partial support. The remaining gaps are intentional stubs for deprecated features, plus Partial Prerendering and Cache Components. Next.js 16 reworked PPR into "use cache"; vinext implements that directive for file-level and function-level caching, but full cacheComponents behavior is still incomplete — see Known gaps we're working on.

✅ = full implementation | 🟡 = partial (runtime behavior correct, some build-time optimizations missing) | ⬜ = intentional stub/no-op

Module shims

Every next/* import is shimmed to a Vite-compatible implementation.

Module Notes
next/link ✅ All props including prefetch (IntersectionObserver), onNavigate, scroll restoration, basePath, locale
next/image 🟡 Remote images via @unpic/react (28 CDNs). Local images via <img> + srcSet. No build-time optimization/resizing
next/head ✅ SSR collection + client-side DOM manipulation
next/router ✅ useRouter, Router singleton, events, client-side navigation, SSR context, i18n
next/navigation ✅ usePathname, useSearchParams, useParams, useRouter, redirect, notFound, forbidden, unauthorized
next/server ✅ NextRequest, NextResponse, NextURL, cookies, userAgent, after, connection, URLPattern
next/headers ✅ Async headers(), cookies(), draftMode()
next/dynamic ✅ ssr: true, ssr: false, loading component
next/script ✅ All 4 strategies (beforeInteractive, afterInteractive, lazyOnload, worker)
next/font/google 🟡 Runtime CDN loading. No self-hosting, font subsetting, or fallback metrics
next/font/local 🟡 Runtime @font-face injection. Not extracted at build time
next/og ✅ OG image generation via @vercel/og (Satori + resvg)
next/cache ✅ revalidateTag, revalidatePath, unstable_cache, pluggable CacheHandler, "use cache" with cacheLife() and cacheTag()
next/form ✅ GET form interception + POST server action delegation
next/legacy/image ✅ Translates legacy props to modern Image
next/error ✅ Default error page component
next/config ✅ getConfig / setConfig
next/document ✅ Html, Head, Main, NextScript
next/constants ✅ All phase constants
next/amp ⬜ No-op (AMP is deprecated)
next/web-vitals ⬜ No-op (use the web-vitals library directly)

Routing

Feature Notes
File-system routing (pages/) ✅ Automatic scanning with hot-reload on file changes
File-system routing (app/) ✅ Pages, routes, layouts, templates, loading, error, not-found, forbidden, unauthorized
Dynamic routes [param] ✅ Both routers
Catch-all [...slug] ✅ Both routers
Optional catch-all [[...slug]] ✅ Both routers
Route groups (group) ✅ URL-transparent, layouts still apply
Parallel routes @slot ✅ Discovery, layout props, default.tsx, inherited slots
Intercepting routes ✅ (.), (..), (..)(..), (...) conventions
Route handlers (route.ts) ✅ Named HTTP methods, auto OPTIONS/HEAD, cookie attachment
Middleware ✅ middleware.ts and proxy.ts (Next.js 16). Matcher patterns (string, array, regex, :param, :path*, :path+)
i18n routing 🟡 Pages Router locale prefix, Accept-Language detection, NEXT_LOCALE cookie. No domain-based routing
basePath ✅ Applied everywhere — URLs, Link, Router, navigation hooks
trailingSlash ✅ 308 redirects to canonical form

Server features

Feature Notes
SSR (Pages Router) ✅ Streaming, _app/_document, __NEXT_DATA__, hydration
SSR (App Router) ✅ RSC pipeline, nested layouts, streaming, nav context for client components
getStaticProps ✅ Props, redirect, notFound, revalidate
getStaticPaths ✅ fallback: false, true, "blocking"
getServerSideProps ✅ Full context including locale
ISR ✅ Stale-while-revalidate, pluggable CacheHandler, background regeneration
Server Actions ("use server") ✅ Action execution, FormData, re-render after mutation, redirect() in actions
React Server Components ✅ Via @vitejs/plugin-rsc. "use client" boundaries work correctly
Streaming SSR ✅ Both routers
Metadata API ✅ metadata, generateMetadata, viewport, generateViewport, title templates
generateStaticParams ✅ With dynamicParams enforcement
Metadata file routes ✅ sitemap.xml, robots.txt, manifest, favicon, OG images (static + dynamic)
Static export (output: 'export') ✅ Generates static HTML/JSON for all routes
Standalone output (output: 'standalone') ✅ Generates dist/standalone with server.js, build artifacts, and runtime deps
connection() ✅ Forces dynamic rendering
"use cache" directive ✅ File-level and function-level. cacheLife() with built-in and next.config cacheLife (or legacy experimental.cacheLife) profiles, cacheTag(), stale-while-revalidate
instrumentation.ts ✅ register(), onRequestError(), and framework tracing
Route segment config 🟡 revalidate, dynamic, dynamicParams, runtime (not placement). No preferredRegion

Configuration

Feature Notes
next.config.js / .ts / .mjs ✅ Function configs, phase argument
rewrites / redirects / headers ✅ All phases, param interpolation. A source Next.js rejects fails config loading, as it fails the Next.js build: missing, not starting with /, over the 4,096-character built-regex limit, or rejected by path-to-regexp, such as a header glob /api/*
Environment variables (.env*, NEXT_PUBLIC_*) ✅ Auto-loads Next.js-style dotenv files; only public vars are inlined
images config 🟡 Parsed but not used for optimization; the production image endpoint enforces localPatterns (dev serves any local source)
experimental.optimizePackageImports ✅ Rewrites barrel imports to direct sub-module imports in RSC/SSR environments. A default set (lucide-react, date-fns, radix-ui, antd, MUI, and others) are always optimized. Add package names here to extend the list.
vinext({ nextConfig }) ✅ Inline Next-style config from vite.config.*. Supports object-form and function-form config. When provided, this overrides root next.config.*.
vinext({ react: { compiler: true } }) ✅ React Compiler auto memoization. Needs @vitejs/plugin-react 6.1+ and the optional oxc-transform-react package.
vinext({ disableNextLikeChunking: true }) ✅ Loads each client component from its own chunk, instead of one chunk per route group (Next.js-like; App Router production builds). Grouping also turns off on its own when the client build has other chunk groups.

React Compiler

vinext auto-registers @vitejs/plugin-react, so the React Compiler is enabled through the same react option:

import { defineConfig } from "vite";
import vinext from "vinext";

export default defineConfig({
  plugins: [vinext({ react: { compiler: true } })],
});

The transform itself ships separately, so install it alongside:

npm install -D oxc-transform-react

This requires @vitejs/plugin-react 6.1.0 or newer. Older versions accept the option and drop it, so vinext fails with an actionable error instead of leaving the compiler silently disabled. The compiler runs on the client environment only.

One caveat: modules whose JSX is lowered earlier in the pipeline are not memoized. Those build and behave correctly, they just miss auto memoization:

  • JSX in plain .js files, which vinext:jsx-in-js compiles first so the compiler can parse them at all. Rename to .jsx or .tsx to get memoization.
  • Components using <style jsx>, which vinext:styled-jsx compiles through the Next.js SWC transform before the compiler runs.

Environment variable loading (.env*)

vinext automatically loads dotenv files for dev, build, start, and deploy.

Vite evaluates all static config imports before plugin hooks, regardless of import order. vinext dev and vinext build preload dotenv from the project root before handing off to Vite, preserving the old CLI's config-time behavior. Direct vite dev and vite build do not. For config-time values that work with either command, use Vite's loadEnv(mode, process.cwd(), "") in a config factory and read its returned values rather than relying on process.env in a static import. The empty prefix includes server-only variables; use your custom envDir in place of process.cwd() if you have one.

Load order matches Next.js (highest priority first):

  1. Existing process.env values (shell/CI)
  2. .env.<mode>.local
  3. .env.local (skipped when mode is test)
  4. .env.<mode>
  5. .env

Modes:

  • vite dev uses development
  • vite build, vinext start, and @vinext/cloudflare deploy use production
  • vinext dev and vinext build use the corresponding mode, including --mode overrides

Variable expansion ($VAR / ${VAR}) is supported.

Client exposure remains explicit:

  • NEXT_PUBLIC_* variables are inlined for browser usage
  • next.config.js env entries are also inlined
  • Other env vars stay server-only unless you explicitly expose them through Vite (for example VITE_* + import.meta.env)

Override behavior:

  • To override any .env* value, set it in your shell/CI environment before running vinext. Existing process.env always wins.

Caching

The cache is pluggable. The default MemoryCacheHandler works out of the box. Swap in your own backend for production.

Configuring cache adapters from vite.config

Instead of wiring up cache handlers imperatively from a worker entry, you can declare them in the vinext() plugin config. The @vinext/cloudflare package ships Cloudflare adapters for this:

  • kvDataAdapter() (@vinext/cloudflare/cache/kv-data-adapter) — backs the "use cache" data cache with a Workers KV namespace.
  • workersCacheCdnAdapter() (@vinext/cloudflare/cache/workers-cache-cdn-adapter) — serves page-level ISR from the Cloudflare Workers Cache (ctx.cache) instead of from the origin.
  • staticAssetsAdapter() (@vinext/cloudflare/cache/static-assets-adapter) — packages locally prerendered App Router HTML/RSC into Workers Static Assets and serves it through a read-only page cache.
  • responseStoreAdapter() (@vinext/cloudflare/cache/response-store-adapter) — uses Workers Response Store for both responses and data, with service-binding or self-contained deployment modes. See the config examples for both modes.

The KV and Workers Cache adapters fill different slots and can be used together:

import { workersCacheCdnAdapter } from "@vinext/cloudflare/cache/workers-cache-cdn-adapter";
import { kvDataAdapter } from "@vinext/cloudflare/cache/kv-data-adapter";

vinext({
  cache: {
    cdn: workersCacheCdnAdapter(),
    data: kvDataAdapter(),
  },
});

The KV data adapter reads env[binding] at runtime. Configure its namespace and the Workers Cache entrypoints in cloudflare.config.ts. Here, existingExports is your current Worker's exports object, or {} if it has none:

import { bindings } from "cf/config";
import { createWorkersCacheConfig } from "@vinext/cloudflare/cache/config";

const cache = await crea

(README truncated)

View on GitHub

Recent activity

commits and pull requests

Releases and announcements

120 total
  1. ### Bug Fixes #### App Router - let a navigation commit over an older server action's refresh render (#4721) - check client reference chunk links in constant time (#4699) - return route handler WebSocket upgrade responses unchanged (#4682) #### Misc - **Cloudflare:** skip warming routes that middleware or proxy answers itself (#4703) - **Build:** return a sourcemap for the action owner manifest import rewrite (#4679) - **Pages Router:** stop the hydration query update from reloading the current URL (#4693) - **Prerender:** assign the owned prod server outside a closure (#4695) - **Prerender:** run the prerender server in a forked process (#4687) ### Performance - let the Response Store drop duplicate fills of a data cache miss (#4642) ### Contributors - @james-elicx

  2. ### Features - **Response Store:** opt-in purgeBatchWindow to batch edge purges (#4674) - **Cloudflare:** record a version message and tag on deploy (#4689) ### Bug Fixes - **Cloudflare:** skip warming routes that middleware or proxy answers itself (#4703) - **Cloudflare:** read v1 Build Output alongside v0 (#4704) - **App Router:** return route handler WebSocket upgrade responses unchanged (#4682) ### Performance - let the Response Store drop duplicate fills of a data cache miss (#4642) ### Contributors - @james-elicx

  3. ### Features - **Response Store:** opt-in purgeBatchWindow to batch edge purges (#4674) ### Bug Fixes - **Response Store:** resend only refused edge requests (#4691) ### Performance #### Response Store - drop a fill of a miss another fill already replaced (#4641) - skip the edge purge when a put replaces a tombstone whose edge purge completed (#4640) - skip the edge purge when a put replaces a stale entry with a revalidator (#4639) ### Contributors - @james-elicx

  4. ### Bug Fixes #### App Router - prefetch loading shells for search-param hrefs without Cache Components (#4660) - enforce dynamicParams = false for route handlers (#4125) - render dynamicParams misses as a routing-level not-found (#4122) - let the latest navigation commit over a superseded one's render (#4633) #### Pages Router - render /500 as HTML for a _next/data request (#4629) - answer a direct /500 request with 500 (#4626) - answer a direct /404 request with 404 in dev (#4612) #### Misc - align Server Function proxy transforms with @vitejs/plugin-rsc (#4630) - **Styled Jsx:** load Next's prebundled styled-jsx in the dev client (#4621) - **Use Cache:** compile .mts cache modules like other source files (#4627) - keep the App Router navigation runtime out of Pages Router bundles (#4617) - **Cloudflare:** stop dev answering 500 for paths that parse as an invalid host (#4616) - **Pages:** drop the default viewport when next/head sets one (#4614) - **Dev:** scan pages/ for client and ssr deps when app/ also exists (#4613) - **Head:** ignore next/head in the App Router like Next.js (#4610) - **Server:** shut down the production server gracefully on SIGTERM and SIGINT (#4611)

  5. This release changes the `@vinext/cloudflare previews deploy` command to use a `--preview-name` flag instead of a positional arg for preview names, to align with an upstream breaking change that the cf CLI did. ### Bug Fixes #### Cloudflare - pass the Preview name with --preview-name like cf (#4572) - never store a Range request's 206 in the Response Store (#4622) - read the log cf writes to stderr during version deploys (#4609) #### Misc - **Init:** stop adding nodejs_compat now that compat dates enable it (#4580) ### Contributors - @james-elicx

Code frequency

additions and deletions
+103.5K-103.5KWeek of 2026-02-22: +103,450 linesWeek of 2026-02-22: -2,250 linesWeek of 2026-03-01: +19,823 linesWeek of 2026-03-01: -7,901 linesWeek of 2026-03-08: +71,554 linesWeek of 2026-03-08: -24,253 linesWeek of 2026-03-15: +32,981 linesWeek of 2026-03-15: -19,183 linesWeek of 2026-03-22: +9,101 linesWeek of 2026-03-22: -6,641 linesWeek of 2026-03-29: +12,414 linesWeek of 2026-03-29: -4,425 linesWeek of 2026-04-05: +10,074 linesWeek of 2026-04-05: -2,725 linesWeek of 2026-04-12: +5,381 linesWeek of 2026-04-12: -3,200 linesWeek of 2026-04-19: +6,161 linesWeek of 2026-04-19: -919 linesWeek of 2026-04-26: +42,377 linesWeek of 2026-04-26: -24,400 linesWeek of 2026-05-03: +27,479 linesWeek of 2026-05-03: -7,484 linesWeek of 2026-05-10: +26,584 linesWeek of 2026-05-10: -4,615 linesWeek of 2026-05-17: +40,863 linesWeek of 2026-05-17: -4,590 linesWeek of 2026-05-24: +20,963 linesWeek of 2026-05-24: -1,183 linesWeek of 2026-05-31: +41,359 linesWeek of 2026-05-31: -10,812 linesWeek of 2026-06-07: +46,473 linesWeek of 2026-06-07: -7,123 linesWeek of 2026-06-14: +45,346 linesWeek of 2026-06-14: -7,924 linesWeek of 2026-06-21: +24,542 linesWeek of 2026-06-21: -7,207 linesWeek of 2026-06-28: +36,658 linesWeek of 2026-06-28: -6,018 linesWeek of 2026-07-05: +9,389 linesWeek of 2026-07-05: -2,723 linesWeek of 2026-07-12: +55,489 linesWeek of 2026-07-12: -7,480 linesWeek of 2026-07-19: +25,149 linesWeek of 2026-07-19: -2,981 linesWeek of 2026-07-26: +17,739 linesWeek of 2026-07-26: -3,359 linesWeek of 2026-08-02: +8,665 linesWeek of 2026-08-02: -1,295 linesWeek of 2026-08-09: +14,938 linesWeek of 2026-08-09: -1,668 linesWeek of 2026-08-16: +19,067 linesWeek of 2026-08-16: -2,327 linesWeek of 2026-08-23: +10,955 linesWeek of 2026-08-23: -1,394 linesWeek of 2026-08-30: +18,910 linesWeek of 2026-08-30: -2,218 linesWeek of 2026-09-06: +24,513 linesWeek of 2026-09-06: -3,587 linesWeek of 2026-09-13: +16,529 linesWeek of 2026-09-13: -6,001 linesWeek of 2026-09-20: +43,350 linesWeek of 2026-09-20: -7,639 linesWeek of 2026-09-27: +45,947 linesWeek of 2026-09-27: -8,936 linesWeek of 2026-10-04: +36,282 linesWeek of 2026-10-04: -8,717 linesWeek of 2026-10-11: +36,523 linesWeek of 2026-10-11: -6,273 linesWeek of 2026-10-18: +41,647 linesWeek of 2026-10-18: -9,776 linesWeek of 2026-10-25: +31,893 linesWeek of 2026-10-25: -16,123 linesWeek of 2026-11-01: +21,486 linesWeek of 2026-11-01: -3,455 linesWeek of 2026-11-08: +17,490 linesWeek of 2026-11-08: -6,839 linesWeek of 2026-11-15: +6,636 linesWeek of 2026-11-15: -870 linesFeb 22, 2026Nov 15, 2026
+1.1M lines added, -256.5K removed over the last year.

Commits per week

last 52 weeks
1510Week of 2025-11-23: 0 commitsWeek of 2025-11-30: 0 commitsWeek of 2025-12-07: 0 commitsWeek of 2025-12-14: 0 commitsWeek of 2025-12-21: 0 commitsWeek of 2025-12-28: 0 commitsWeek of 2026-01-04: 0 commitsWeek of 2026-01-11: 0 commitsWeek of 2026-01-18: 0 commitsWeek of 2026-01-25: 0 commitsWeek of 2026-02-01: 0 commitsWeek of 2026-02-08: 0 commitsWeek of 2026-02-15: 0 commitsWeek of 2026-02-22: 88 commitsWeek of 2026-03-01: 80 commitsWeek of 2026-03-08: 151 commitsWeek of 2026-03-15: 68 commitsWeek of 2026-03-22: 36 commitsWeek of 2026-03-29: 38 commitsWeek of 2026-04-05: 30 commitsWeek of 2026-04-12: 26 commitsWeek of 2026-04-19: 23 commitsWeek of 2026-04-26: 87 commitsWeek of 2026-05-03: 101 commitsWeek of 2026-05-10: 87 commitsWeek of 2026-05-17: 123 commitsWeek of 2026-05-24: 91 commitsWeek of 2026-05-31: 77 commitsWeek of 2026-06-07: 129 commitsWeek of 2026-06-14: 143 commitsWeek of 2026-06-21: 94 commitsWeek of 2026-06-28: 111 commitsWeek of 2026-07-05: 25 commitsWeek of 2026-07-12: 34 commitsWeek of 2026-07-19: 45 commitsWeek of 2026-07-26: 36 commitsWeek of 2026-08-02: 32 commitsWeek of 2026-08-09: 42 commitsWeek of 2026-08-16: 46 commitsWeek of 2026-08-23: 18 commitsWeek of 2026-08-30: 20 commitsWeek of 2026-09-06: 29 commitsWeek of 2026-09-13: 32 commitsWeek of 2026-09-20: 87 commitsWeek of 2026-09-27: 121 commitsWeek of 2026-10-04: 94 commitsWeek of 2026-10-11: 143 commitsWeek of 2026-10-18: 125 commitsWeek of 2026-10-25: 100 commitsWeek of 2026-11-01: 100 commitsWeek of 2026-11-08: 54 commitsWeek of 2026-11-15: 19 commitsNov 23, 2025Nov 15, 2026
2.8K commits in the last 52 weeks.

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 — 12 commitsSun 1:00 — 21 commitsSun 2:00 — 11 commitsSun 3:00 — 9 commitsSun 4:00 — 15 commitsSun 5:00 — 15 commitsSun 6:00 — 6 commitsSun 7:00 — 8 commitsSun 8:00 — 1 commitsSun 9:00 — 5 commitsSun 10:00 — 4 commitsSun 11:00 — 5 commitsSun 12:00 — 3 commitsSun 13:00 — 2 commitsSun 14:00 — 6 commitsSun 15:00 — 5 commitsSun 16:00 — 5 commitsSun 17:00 — 5 commitsSun 18:00 — 7 commitsSun 19:00 — 12 commitsSun 20:00 — 23 commitsSun 21:00 — 26 commitsSun 22:00 — 18 commitsSun 23:00 — 19 commitsMon 0:00 — 19 commitsMon 1:00 — 5 commitsMon 2:00 — 13 commitsMon 3:00 — 8 commitsMon 4:00 — 2 commitsMon 5:00 — 3 commitsMon 6:00 — 5 commitsMon 7:00 — 9 commitsMon 8:00 — 8 commitsMon 9:00 — 44 commitsMon 10:00 — 49 commitsMon 11:00 — 33 commitsMon 12:00 — 15 commitsMon 13:00 — 45 commitsMon 14:00 — 26 commitsMon 15:00 — 25 commitsMon 16:00 — 13 commitsMon 17:00 — 16 commitsMon 18:00 — 14 commitsMon 19:00 — 41 commitsMon 20:00 — 25 commitsMon 21:00 — 63 commitsMon 22:00 — 29 commitsMon 23:00 — 48 commitsTue 0:00 — 35 commitsTue 1:00 — 20 commitsTue 2:00 — 13 commitsTue 3:00 — 10 commitsTue 4:00 — 4 commitsTue 5:00 — 6 commitsTue 6:00 — 16 commitsTue 7:00 — 9 commitsTue 8:00 — 11 commitsTue 9:00 — 14 commitsTue 10:00 — 45 commitsTue 11:00 — 28 commitsTue 12:00 — 18 commitsTue 13:00 — 15 commitsTue 14:00 — 34 commitsTue 15:00 — 29 commitsTue 16:00 — 31 commitsTue 17:00 — 25 commitsTue 18:00 — 17 commitsTue 19:00 — 41 commitsTue 20:00 — 29 commitsTue 21:00 — 36 commitsTue 22:00 — 20 commitsTue 23:00 — 17 commitsWed 0:00 — 13 commitsWed 1:00 — 11 commitsWed 2:00 — 5 commitsWed 3:00 — 10 commitsWed 4:00 — 15 commitsWed 5:00 — 9 commitsWed 6:00 — 14 commitsWed 7:00 — 5 commitsWed 8:00 — 6 commitsWed 9:00 — 23 commitsWed 10:00 — 25 commitsWed 11:00 — 31 commitsWed 12:00 — 10 commitsWed 13:00 — 23 commitsWed 14:00 — 12 commitsWed 15:00 — 10 commitsWed 16:00 — 23 commitsWed 17:00 — 16 commitsWed 18:00 — 12 commitsWed 19:00 — 23 commitsWed 20:00 — 16 commitsWed 21:00 — 19 commitsWed 22:00 — 31 commitsWed 23:00 — 25 commitsThu 0:00 — 11 commitsThu 1:00 — 17 commitsThu 2:00 — 15 commitsThu 3:00 — 9 commitsThu 4:00 — 2 commitsThu 5:00 — 4 commitsThu 6:00 — 7 commitsThu 7:00 — 8 commitsThu 8:00 — 9 commitsThu 9:00 — 13 commitsThu 10:00 — 25 commitsThu 11:00 — 26 commitsThu 12:00 — 21 commitsThu 13:00 — 18 commitsThu 14:00 — 20 commitsThu 15:00 — 23 commitsThu 16:00 — 28 commitsThu 17:00 — 21 commitsThu 18:00 — 21 commitsThu 19:00 — 18 commitsThu 20:00 — 35 commitsThu 21:00 — 34 commitsThu 22:00 — 19 commitsThu 23:00 — 23 commitsFri 0:00 — 21 commitsFri 1:00 — 6 commitsFri 2:00 — 4 commitsFri 3:00 — 4 commitsFri 4:00 — 10 commitsFri 5:00 — 15 commitsFri 6:00 — 5 commitsFri 7:00 — 5 commitsFri 8:00 — 9 commitsFri 9:00 — 15 commitsFri 10:00 — 25 commitsFri 11:00 — 36 commitsFri 12:00 — 19 commitsFri 13:00 — 12 commitsFri 14:00 — 20 commitsFri 15:00 — 24 commitsFri 16:00 — 17 commitsFri 17:00 — 10 commitsFri 18:00 — 14 commitsFri 19:00 — 20 commitsFri 20:00 — 25 commitsFri 21:00 — 25 commitsFri 22:00 — 25 commitsFri 23:00 — 28 commitsSat 0:00 — 22 commitsSat 1:00 — 15 commitsSat 2:00 — 11 commitsSat 3:00 — 2 commitsSat 4:00 — 4 commitsSat 5:00 — 1 commitsSat 6:00 — 15 commitsSat 7:00 — 7 commitsSat 8:00 — 12 commitsSat 9:00 — 7 commitsSat 10:00 — 6 commitsSat 11:00 — 9 commitsSat 12:00 — 3 commitsSat 13:00 — 5 commitsSat 14:00 — 10 commitsSat 15:00 — 13 commitsSat 16:00 — 6 commitsSat 17:00 — 18 commitsSat 18:00 — 18 commitsSat 19:00 — 12 commitsSat 20:00 — 12 commitsSat 21:00 — 2 commitsSat 22:00 — 21 commitsSat 23:00 — 25 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.
DateListRankStars gained
Feb 26, 2026daily#16+211
Feb 25, 2026daily#2+601
  • morluto/rea

    Reverse engineer anything with agents, from app behavior down to native binaries.

    471.6K stars · TypeScript

  • freeCodeCamp/freeCodeCamp

    freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

    459.4K stars · TypeScript

  • openclaw/openclaw

    The AI that really does things. Any OS. Any Platform. The lobster way. 🦞

    394.9K stars · TypeScript

  • anomalyco/opencode

    The open source coding agent.

    228.3K stars · TypeScript

  • n8n-io/n8n

    Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

    211.6K stars · TypeScript

  • firecrawl/firecrawl

    Knowledge infrastructure to make your agents smarter. Search, scrape and access 550+ data providers through one API.

    205.3K stars · TypeScript