Skip to main content
The vinext CLI is a drop-in replacement for the next command that runs your Next.js app on Vite instead of webpack.

Installation

Quick Start

Available Commands

The vinext CLI provides these commands:

Global Options

These options work with all commands:
flag
Show help for a command
flag
Show version information

Version Information

Check the installed vinext and Vite versions:
During execution, vinext will show the Vite version being used:

Configuration

vinext requires minimal configuration:

Automatic Configuration (No Config File)

If you don’t have a vite.config.ts file, vinext auto-configures everything:
  • Registers the vinext plugin automatically
  • Auto-detects App Router (app/ directory) and registers RSC plugin
  • Deduplicates React packages (prevents “Invalid hook call” errors)
  • Works with both app/ and src/app/, pages/ and src/pages/

Manual Configuration (vite.config.ts)

For custom setups, create a vite.config.ts:
If you have a config file, vinext uses it instead of auto-configuration.

Compatibility Flags

vinext accepts some Next.js flags for drop-in compatibility, but ignores them:
flag
Accepted for compatibility with Next.js scripts. No-op (Vite is always used).
flag
Accepted for compatibility. No-op. Configure HTTPS in vite.config.ts if needed.

Environment Variables

vinext respects these environment variables:

Development vs Production

Development Mode (vinext dev)

  • App Router: Uses Vite dev server with HMR for React Server Components
  • Pages Router: Server-side renders on each request with full reload on changes
  • Module resolution: Resolves Vite from your project’s node_modules to prevent dual instances

Production Mode (vinext build + vinext start)

  • App Router: Multi-environment build (RSC, SSR, Client) using createBuilder()
  • Pages Router: Separate client and server builds
  • Output: dist/client/ (static assets), dist/server/ (SSR entry)
  • Optimizations: Code splitting, tree-shaking, minification

Router Detection

vinext automatically detects your router type:

Common Workflows

Local Development

Production Build and Deploy

Migrating an Existing Project

Module Resolution

vinext dynamically resolves Vite from your project’s node_modules at runtime, not from vinext’s own dependencies. This prevents dual Vite instances when using npm link or bun link during development. If Vite cannot be resolved from your project, vinext falls back to its bundled copy.

Next Steps

dev Command

Start the development server

build Command

Build for production

deploy Command

Deploy to Cloudflare Workers

check Command

Check project compatibility