惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Y
Y Combinator Blog
博客园_首页
Martin Fowler
Martin Fowler
博客园 - 司徒正美
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
B
Blog
有赞技术团队
有赞技术团队
A
About on SuperTechFans
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
阮一峰的网络日志
阮一峰的网络日志
Jina AI
Jina AI

Heroku Dev Center Articles

Migrating from the Nginx Buildpack to Front-End Web CNB | Heroku Dev Center How the Front-End Web Cloud Native Buildpack Works | Heroku Dev Center Deploying Front-End Web Apps on Heroku | Heroku Dev Center Understanding Heroku User Roles and Permissions | Heroku Dev Center Choosing the Right Apache Kafka on Heroku Plan | Heroku Dev Center Provisioning Apache Kafka on Heroku | Heroku Dev Center Managing Topics and Partitions on Apache Kafka on Heroku | Heroku Dev Center Apache Kafka on Heroku Version Support | Heroku Dev Center Changing the Plan of an Apache Kafka on Heroku Cluster | Heroku Dev Center Connecting to an Apache Kafka on Heroku Cluster | Heroku Dev Center Apache Kafka on Heroku Metrics Logs | Heroku Dev Center Heroku GitHub Enterprise Cloud Integration Using GitHub Apps | Heroku Dev Center Heroku Connect for Independent Software Vendors (ISV) | Heroku Dev Center Managed Inference and Agents API with Claude Opus 4.8 | Heroku Dev Center Heroku-26 Stack | Heroku Dev Center Connection Limits on Heroku Postgres Advanced (Limited GA) | Heroku Dev Center Heroku Postgres Advanced (Limited GA) | Heroku Dev Center Migrating to Heroku Postgres Advanced (Limited GA) | Heroku Dev Center Heroku Postgres Advanced Quotas (Limited GA) | Heroku Dev Center Manage Instance Pools on Heroku Postgres Advanced (Limited GA) | Heroku Dev Center Provisioning Heroku Postgres Advanced (Limited GA) | Heroku Dev Center Getting Started with Heroku Postgres Advanced (Limited GA) | Heroku Dev Center Usage and Billing on Heroku Postgres Advanced (Limited GA) | Heroku Dev Center
Migrating from create-react-app-buildpack to Front-End We...
2026-09-04 · via Heroku Dev Center Articles

Table of Contents [expand]

  • Additional Reading

Last updated September 03, 2026

The Heroku Front-End Web Cloud Native Buildpack (CNB) is the recommended method for deploying static web apps on Heroku.

This migration guide is for you, if you want to update an existing app developed on Heroku using create-react-app-buildpack.

Heroku CI doesn’t support CNBs. If an app’s pipeline currently relies on Heroku CI, don’t migrate the app without a plan for how to migrate to a different CI system.

Create a Branch for Changes

In the app’s Git repo, create a branch to stage these changes:

git checkout -b migrate-to-frontend-web-cnb

Create project.toml

CNB configuration is set with the project.toml file:

[_]
schema-version = "0.2"

[[io.buildpacks.group]]
id = "heroku/nodejs"
# this installs Node.js and runs the build

[[io.buildpacks.group]]
id = "heroku/static-web-server"
# this hosts the website

[[io.buildpacks.group]]
id = "heroku/website-cra"
# this presets the document root and client-side routing

Based on any further customizations in static.json, fill out the project.toml, for example:

# response headers based on static.json "headers"
[com.heroku.static-web-server.headers."/"]
Cache-Control = "max-age=604800, stale-while-revalidate=86400, stale-if-error=86400"

[com.heroku.static-web-server.headers."/*.html"]
Cache-Control = "max-age=604800, stale-while-revalidate=86400, stale-if-error=86400"

[com.heroku.static-web-server.headers."/images/*"]
Cache-Control = "max-age=31536000, immutable"

See all configuration options of the static web server CNB. Not all static.json configuration is supported. Open an issue on GitHub to request features or report bugs.

Commit the new project.toml to the repo:

git add project.toml -m "Front-end Web CNB project config from create-react-app-buildpack"
git commit

Update app.json

For apps in pipelines that use Review Apps, you must update app.json. Set the stack to cnb and remove buildpacks:

{
  "stack": "cnb",
  "buildpacks": []
}

Commit the updated app.json to the repo.

Switch to the CNB Stack

To deploy using project.toml and the Front-End Web CNB, you must switch the app’s stack to cnb:

heroku stack:set cnb --app my-web-app

Every instance of an app from development, staging, and production requires setting the cnb stack. When using Heroku Pipelines, the stack gets updated along with promotions between stages.

Test CNB Deployment

Deploy the migrate-to-frontend-web-cnb branch to a non-production version of the app for testing. After the app builds and launches, verify that the app is working correctly.

Release CNB and Cleanup

After verifying with a non-production app, merge the branch, and deploy or promote to the production app.

After release, you can remove the previous create-react-app-buildpack or buildpack-heroku-static related files:

git remove static.json -m "Clean-up old config"
git commit

Additional Reading