A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/@mars/heroku-js-runtime-env below:

@mars/heroku-js-runtime-env - npm

Heroku JS Runtime Env

Use runtime environment variables in bundled/minified javascript apps.

Usage

Designed for create-react-app-buildpack. See its documentation to use this module for Runtime configuration.

Background

Normally javascript apps are compiled into a bundle before being deployed. During this build phase, environment variables may be embedded in the javascript bundle, such as with Webpack DefinePlugin.

When hosting on a 12-factor platform like Heroku, these embedded values may go stale when setting new config vars or promoting through a pipeline.

How Does It Work?

When developing your app, use Runtime environment variables from create-react-app-buildpack.

Then, each time the app starts-up on Heroku, a .profile.d script (installed from the buildpack) is executed which fills in a JSON placeholder in the JavaScript bundle with the runtime environment variables. The result is 🍃 fresh runtime environment variables in the production javascript bundle without recompiling.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4