Skip to main content
The adapter generates a 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

version
number
required
Build Output API version. Always set to 3.
routes
Route[]
Array of routing rules that define how requests are handled. Routes are processed in order.
images
ImagesConfig
Image optimization configuration derived from Next.js image settings.
wildcard
WildcardConfig
Wildcard domain configuration for i18n. Maps domains to their default locale paths.
overrides
OverridesConfig
required
File override configuration for static assets. Maps paths to custom content types or file paths.
cache
string[]
Array of paths or patterns to cache.

Example configuration

config.json
{
  "version": 3,
  "routes": [
    { "handle": "filesystem" },
    {
      "src": "^/api/(.*)$",
      "dest": "/api/$1"
    }
  ],
  "images": {
    "sizes": [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
    "domains": ["images.example.com"],
    "remotePatterns": [],
    "formats": ["image/avif", "image/webp"]
  },
  "overrides": {}
}

Images configuration

The images object configures Vercel’s image optimization service.
images.sizes
number[]
required
Array of image widths to generate. Combines Next.js imageSizes and deviceSizes.
images.domains
string[]
required
Array of allowed external domains for image optimization.
images.remotePatterns
RemotePattern[]
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 string
  • port: Port number (optional)
  • pathname: Path pattern as a regex source string (optional)
  • search: Query string pattern (optional)
images.localPatterns
LocalPattern[]
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)
images.qualities
number[]
Array of quality values for image optimization (1-100).
images.minimumCacheTTL
number
Minimum cache TTL in seconds for optimized images.
images.formats
ImageFormat[]
Supported image formats: 'image/avif' or 'image/webp'
images.dangerouslyAllowSVG
boolean
Whether to allow SVG image optimization.
images.contentSecurityPolicy
string
Content Security Policy for image responses.
images.contentDispositionType
string
Content-Disposition type for image responses.

Example images configuration

{
  "images": {
    "sizes": [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080],
    "domains": ["cdn.example.com"],
    "remotePatterns": [
      {
        "protocol": "https",
        "hostname": "images\\.example\\.com",
        "pathname": "\\/uploads\\/.*"
      }
    ],
    "qualities": [75, 90, 100],
    "minimumCacheTTL": 60,
    "formats": ["image/avif", "image/webp"],
    "dangerouslyAllowSVG": false
  }
}
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

The wildcard array configures domain-specific i18n routing.
wildcard[].domain
string
required
Domain name for this wildcard configuration.
wildcard[].value
string
required
Path prefix for this domain. Empty string for domains using the default locale.

Example wildcard configuration

{
  "wildcard": [
    {
      "domain": "example.com",
      "value": ""
    },
    {
      "domain": "example.fr",
      "value": "/fr"
    }
  ]
}
This configuration routes requests to example.com without a locale prefix (default locale) and requests to example.fr with the /fr prefix.

Overrides configuration

The overrides object maps file paths to custom configurations.
overrides[path].path
string
Custom file path to serve instead of the default.
overrides[path].contentType
string
Custom content type for the file.

Example overrides configuration

{
  "overrides": {
    "/_next/static/css/custom.css": {
      "contentType": "text/css; charset=utf-8"
    }
  }
}

Routes configuration

The routes 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 status and dest fields
  • Rewrite routes: Include dest field for internal rewrites
  • Header routes: Include headers field to set response headers
  • Conditional routes: Include has or missing fields for conditional matching

Example routes

{
  "routes": [
    {
      "src": "^/old-path$",
      "dest": "/new-path",
      "status": 308
    },
    { "handle": "filesystem" },
    {
      "src": "^/api/(.*)$",
      "dest": "/api/$1",
      "check": true
    },
    { "handle": "error" }
  ]
}
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:
.next/output/config.json
This directory also contains:
  • Function bundles in .next/output/functions/
  • Static files in .next/output/static/
  • Prerender manifests in .next/output/prerender/

Build docs developers (and LLMs) love