Usage
Options
Build for Vercel deployment. Generates the
.vercel/output directory structure required by Vercel’s Build Output API.This option can also be triggered by setting the VERCEL environment variable to "1".This flag is ignored when using the experimental adapter configuration.
Build for Cloudflare Workers deployment. Prepares artifacts optimized for Cloudflare Workers runtime.This option can also be triggered by setting the
CF_PAGES environment variable to "1".Examples
Standard production build:How it works
The build command:- Initializes the compiler context in production mode
- Compiles all source files with optimizations
- Generates platform-specific output when flags are set
- Creates deployment-ready artifacts
Vercel output
When building with--vercel, the command generates:
.vercel/output/config.json- Vercel configuration.vercel/output/functions/- Serverless functions.vercel/output/static/- Static assets
Cloudflare output
When building with--cf, the command generates:
- Cloudflare Workers compatible bundle
- Optimized for edge runtime execution
Related
dev
Start development mode
Deployment guides
Learn how to deploy your server