Build provides three deployment targets: preview (automatic on every change), staging (manual promotion), and production (manual promotion with review).
Every change triggers an automatic preview deployment. Preview URLs follow the pattern {"{project}"}-{"{branch}"}-{"{commit}"}.preview.build.poly.inc. Previews are ephemeral and expire after 7 days of inactivity.
branchstring(required)Branch that triggers deploymentautoDeploybooleanfalseDeploy automatically on push to branchrequireApprovalbooleanfalseRequire team approval before deployingenvobject{}Environment overrides for this target
Fine-tune the build process for production deployments:
build.json
json
{
"build": {
"command": "npm run build",
"outputDirectory": ".next",
"nodeVersion": "20",
"cache": true,
"optimization": {
"minify": true,
"sourceMaps": false,
"compress": true
}
}
}
commandstringautoBuild command for productionoutputDirectorystringautoDirectory containing build outputnodeVersionstring20Node.js version for buildcachebooleantrueCache node_modules between buildsoptimization.minifybooleantrueMinify JavaScript and CSSoptimization.sourceMapsbooleanfalseInclude source mapsoptimization.compressbooleantrueGzip compress static assets