1.0.7 • Published 7 years ago

js-runtime-env v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

JS Runtime Env

Use runtime environment variables in bundled/minified javascript apps.

Build Status npm Module

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.

In coordination with the Heroku runtime through a .profile.d script setup by the buildpack, this tiny module allows the runtime to inject environment variables into the production javascript bundle without recompiling.