This Prebuilt Deployment example demonstrates how to override configuration of static files in a Deployment using the Build Output API.
https://build-output-api-overrides.vercel.sh
The .vercel/output/static
directory contains static files, however due to the "overrides"
property in the .vercel/output/config.json
file, these files are served by Vercel
at different URL paths and/or with a different Content-Type
header.
Specifically:
/something-else
: serves "another.html"/another.html
: 404s/data
: serves the "data" file withContent-Type: application/json
This could similarly be achieved with "routes" configuration, but when possible it is better to use "overrides" because they are implemented at a lower level than routes and don't count towards the total routes limit.