Skip to content

Simple tool to create dump react env vars to a file

License

Notifications You must be signed in to change notification settings

doddle/react-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-env

A simple+secure (single file) tool to create dump react env vars to a file.

This is useful to dynamically configure PWA/SPA static asset sites (running in kubernetes).

how does it work

in your index.html you'd have something such as:

<script src="/.env.js" />

You'd then be able to load data/settings from window.env.

..for example:

image

usage

❯ ./react-env  --help
Usage of ./react-env:
      --dest string     Destination path to write to (relative or absolute) (default ".")
      --file string     name of the file to write (default ".env.js")
      --prefix string   Prefixes of env vars to look for (default "REACT_APP_")
pflag: help requested

Sorry, more docs to follow + Docker examples

attribution

Inspired by https://github.com/andrewmclagan/react-env

About

Simple tool to create dump react env vars to a file

Resources

License

Stars

Watchers

Forks

Packages

No packages published