The vinext CLI is a drop-in replacement for theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/cloudflare/vinext/llms.txt
Use this file to discover all available pages before exploring further.
next command that runs your Next.js app on Vite instead of webpack.
Installation
Quick Start
Available Commands
The vinext CLI provides these commands:| Command | Description |
|---|---|
dev | Start development server with Vite and HMR |
build | Build for production (auto-detects App/Pages Router) |
start | Serve production build |
deploy | One-command deployment to Cloudflare Workers |
init | Migrate an existing Next.js project to vinext |
check | Scan project for compatibility issues |
lint | Run linter (delegates to eslint or oxlint) |
Global Options
These options work with all commands:Show help for a command
Show version information
Version Information
Check the installed vinext and Vite versions:Configuration
vinext requires minimal configuration:Automatic Configuration (No Config File)
If you don’t have avite.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/andsrc/app/,pages/andsrc/pages/
Manual Configuration (vite.config.ts)
For custom setups, create avite.config.ts:
Compatibility Flags
vinext accepts some Next.js flags for drop-in compatibility, but ignores them:Accepted for compatibility with Next.js scripts. No-op (Vite is always used).
Accepted for compatibility. No-op. Configure HTTPS in
vite.config.ts if needed.Environment Variables
vinext respects these environment variables:| Variable | Description | Default |
|---|---|---|
PORT | Production server port (used by vinext start) | 3000 |
CLOUDFLARE_API_TOKEN | API token for Cloudflare Workers deployment | - |
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_modulesto 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’snode_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