Menu
Important
Stay updated on React2Shell

Build Output Configuration

Last updated August 15, 2025

.vercel/output/config.json


Schema (as TypeScript):

Config Types:


The file contains configuration information and metadata for a Deployment. The individual properties are described in greater detail in the sub-sections below.

At a minimum, a file with a property is required.

.vercel/output/config.json


The property indicates which version of the Build Output API has been implemented. The version described in this document is version .

.vercel/output/config.json



The property describes the routing rules that will be applied to the Deployment. It uses the same syntax as the property of the file.

Routes may be used to point certain URL paths to others on your Deployment, attach response headers to paths, and various other routing-related use-cases.

KeyTypeRequiredDescription
srcStringYesA PCRE-compatible regular expression that matches each incoming pathname (excluding querystring).
destStringNoA destination pathname or full URL, including querystring, with the ability to embed capture groups as $1, $2, or named capture value $name.
headersMapNoA set of headers to apply for responses.
methodsString[]NoA set of HTTP method types. If no method is provided, requests with any HTTP method will be a candidate for the route.
continueBooleanNoA boolean to change matching behavior. If true, routing will continue even when the src is matched.
caseSensitiveBooleanNoSpecifies whether or not the route should match with case sensitivity.
checkBooleanNoIf , the route triggers and
statusNumberNoA status code to respond with. Can be used in tandem with Location: header to implement redirects.
hasHasFieldNoConditions of the HTTP request that must exist to apply the route.
missingHasFieldNoConditions of the HTTP request that must NOT exist to match the route.
localeLocaleNoConditions of the Locale of the requester that will redirect the browser to different routes.
middlewareRawSrcString[]NoA list containing the original routes used to generate the .
middlewarePathStringNoPath to an Edge Runtime function that should be invoked as middleware.
mitigateMitigateNoA mitigation action to apply to the route.
transformsTransform[]NoA list of transforms to apply to the route.
Source route:
KeyTypeRequiredDescription
eqString | NumberNoValue must equal this exact value.
neqStringNoValue must not equal this value.
incString[]NoValue must be included in this array.
nincString[]NoValue must not be included in this array.
preStringNoValue must start with this prefix.
sufStringNoValue must end with this suffix.
reStringNoValue must match this regular expression.
gtNumberNoValue must be greater than this number.
gteNumberNoValue must be greater than or equal to this number.
ltNumberNoValue must be less than this number.
lteNumberNoValue must be less than or equal to this number.
Source route:
KeyTypeRequiredDescription
type"host" | "header" | "cookie" | "query"YesDetermines the HasField type.
keyStringNo*Required for header, cookie, and query types. The key to match against.
valueString | MatchableValueNoThe value to match against using string or MatchableValue conditions.
Source route:
KeyTypeRequiredDescription
redirectMapYesAn object of keys that represent locales to check for (, , etc.) that map to routes to redirect to (, , etc.).
cookieStringNoCookie name that can override the Accept-Language header for determining the current locale.
Source route:
KeyTypeRequiredDescription
action"challenge" | "deny"YesThe action to take when the route is matched.
Source route:
KeyTypeRequiredDescription
type"request.headers" | "response.headers" | "request.query"YesThe type of transform to apply.
op"append" | "set" | "delete"YesThe operation to perform on the target.
targetYesThe target of the transform. Regular expression matching is not supported.
argsString | String[]NoThe arguments to pass to the transform.

The routing system has multiple phases. The value indicates the start of a phase. All following routes are only checked in that phase.

KeyTypeRequiredDescription
handleHandleValueYesThe phase of routing when all subsequent routes should apply.
srcStringNoA PCRE-compatible regular expression that matches each incoming pathname (excluding querystring).
destStringNoA destination pathname or full URL, including querystring, with the ability to embed capture groups as $1, $2.
statusStringNoA status code to respond with. Can be used in tandem with header to implement redirects.

The following example shows a routing rule that will cause the path to perform an HTTP redirect to an external URL:

.vercel/output/config.json



The property defines the behavior of Vercel's native Image Optimization API, which allows on-demand optimization of images at runtime.

KeyTypeRequiredDescription
sizesNumber[]YesAllowed image widths.
domainsString[]YesAllowed external domains that can use Image Optimization. Leave empty for only allowing the deployment domain to use Image Optimization.
remotePatternsRemotePattern[]NoAllowed external patterns that can use Image Optimization. Similar to but provides more control with RegExp.
localPatternsLocalPattern[]NoAllowed local patterns that can use Image Optimization. Leave undefined to allow all or use empty array to deny all.
qualitiesNumber[]NoAllowed image qualities. Leave undefined to allow all possibilities, 1 to 100.
minimumCacheTTLNumberNoCache duration (in seconds) for the optimized images.
formatsImageFormat[]NoSupported output image formats
dangerouslyAllowSVGBooleanNoAllow SVG input image URLs. This is disabled by default for security purposes.
contentSecurityPolicyStringNoChange the Content Security Policy of the optimized images.
contentDispositionTypeStringNoSpecifies the value of the response header.

The following example shows an image optimization configuration that specifies allowed image size dimensions, external domains, caching lifetime and file formats:

When the property is defined, the Image Optimization API will be available by visiting the path. When the property is undefined, visiting the path will respond with 404 Not Found.

The API accepts the following query string parameters:

KeyTypeRequiredExampleDescription
urlStringYesThe URL of the source image that should be optimized. Absolute URLs must match a pattern defined in the configuration.
wIntegerYesThe width (in pixels) that the source image should be resized to. Must match a value defined in the configuration.
qIntegerYesThe quality that the source image should be reduced to. Must be between 1 (lowest quality) to 100 (highest quality).

.vercel/output/config.json



The property relates to Vercel's Internationalization feature. The way it works is the domain names listed in this array are mapped to the routing variable, which can be referenced by the configuration.

Each of the domain names specified in the configuration will need to be assigned as Production Domains in the Project Settings.

Objects contained within the configuration support the following properties:

KeyTypeRequiredDescription
domainStringYesThe domain name to match for this wildcard configuration.
valueStringYesThe value of the match that will be available for to utilize.

The following example shows a wildcard configuration where the matching domain name will be served the localized version of the blog post HTML file:

.vercel/output/config.json



The property allows for overriding the output of one or more static files contained within the directory.

The main use-cases are to override the header that will be served for a static file, and/or to serve a static file in the Vercel Deployment from a different URL path than how it is stored on the file system.

Objects contained within the configuration support the following properties:

KeyTypeRequiredDescription
pathStringNoThe URL path where the static file will be accessible from.
contentTypeStringNoThe value of the HTTP response header that will be served with the static file.

The following example shows an override configuration where an HTML file can be accessed without the file extension:

.vercel/output/config.json


The property is an array of file paths and/or glob patterns that should be re-populated within the build sandbox upon subsequent Deployments.

Note that this property is only relevant when Vercel is building a Project from source code, meaning it is not relevant when building locally or when creating a Deployment from "prebuilt" build artifacts.

.vercel/output/config.json


The optional property is an object describing the framework of the built outputs.

This value is used for display purposes only.

.vercel/output/config.json


The optional property is an object describing the cron jobs for the production deployment of a project.


Was this helpful?

supported.