config.json file in the .next/output directory. This file configures how Vercel serves your Next.js application.
This file is automatically generated during the build process. You typically don’t need to modify it directly.
Configuration structure
The generated configuration follows the Vercel Build Output API v3 specification.Root configuration
Build Output API version. Always set to
3.Array of routing rules that define how requests are handled. Routes are processed in order.
Image optimization configuration derived from Next.js image settings.
Wildcard domain configuration for i18n. Maps domains to their default locale paths.
File override configuration for static assets. Maps paths to custom content types or file paths.
Array of paths or patterns to cache.
Example configuration
config.json
Images configuration
Theimages object configures Vercel’s image optimization service.
Array of image widths to generate. Combines Next.js
imageSizes and deviceSizes.Array of allowed external domains for image optimization.
Array of remote URL patterns for image optimization with fine-grained control.Each pattern includes:
protocol:'http'or'https'(optional)hostname: Domain pattern as a regex source stringport: Port number (optional)pathname: Path pattern as a regex source string (optional)search: Query string pattern (optional)
Array of local file patterns for image optimization.Each pattern includes:
pathname: Path pattern as a regex source string (optional)search: Query string pattern (optional)
Array of quality values for image optimization (1-100).
Minimum cache TTL in seconds for optimized images.
Supported image formats:
'image/avif' or 'image/webp'Whether to allow SVG image optimization.
Content Security Policy for image responses.
Content-Disposition type for image responses.
Example images configuration
The
hostname and pathname in remotePatterns are stored as regex source strings, not plain patterns. The adapter automatically converts Next.js patterns using picomatch.Wildcard configuration
Thewildcard array configures domain-specific i18n routing.
Domain name for this wildcard configuration.
Path prefix for this domain. Empty string for domains using the default locale.
Example wildcard configuration
example.com without a locale prefix (default locale) and requests to example.fr with the /fr prefix.
Overrides configuration
Theoverrides object maps file paths to custom configurations.
Custom file path to serve instead of the default.
Custom content type for the file.
Example overrides configuration
Routes configuration
Theroutes array defines routing rules processed in order. Routes are generated based on your Next.js configuration, including redirects, rewrites, headers, and dynamic routes.
Route types
The adapter generates several types of routes:- Handle routes: Special routing handlers like
filesystem,resource,miss,rewrite,hit,error - Redirect routes: Include
statusanddestfields - Rewrite routes: Include
destfield for internal rewrites - Header routes: Include
headersfield to set response headers - Conditional routes: Include
hasormissingfields for conditional matching
Example routes
The routes array is automatically generated from your Next.js configuration, including i18n settings, redirects, rewrites, headers, and dynamic routes. See the adapter source code at
packages/adapter/src/index.ts:261-936 for the complete routing logic.Build output location
The adapter generates the configuration file at:- Function bundles in
.next/output/functions/ - Static files in
.next/output/static/ - Prerender manifests in
.next/output/prerender/