Heroku introduced the Twelve-Factor App philosophy in 2009 for building modern, scalable, and maintainable cloud-native applications. One of its core tenets is Config :
An app’s config is everything that is likely to vary between deploys (staging, production, developer environments, etc).
While this is a solved problem for the server-side, it remains a challenge for the front-end. Most static web apps have configuration, such as environment variables accessed via process.env , compiled directly into their build artifacts. Because these values are “baked in” during the build, a full re-build is required just to change an API URL when an app is promoted from staging to production.
Ten years ago, we published create-react-app-buildpack to solve this problem on Heroku for apps developed with the create-react-app tool. This buildpack performed a lot of magic to inject REACT_ environment variables into the JavaScript bundle at runtime.…