react-env

command module
v0.0.0-...-c8ae6eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL