You may run the following commands to test out this project:
npx react-inject-env build npm run build
npx react-inject-env inject -d ./build -o ./build-black
npx http-server build-black
Try editing the .env
file in the root folder and re-run steps #2 and steps #3
.env
REACT_APP_COLOR = purple
REACT_APP_LOGO_URL =./logo512.png
REACT_APP_MAIN_TEXT = Insert Text here
REACT_APP_LINK_URL = https://my.link
npx react-inject-env inject -d ./build -o ./build-purple
npx http-server build-purple
If an env variable is passed through the command line, it will overwrite variables in the .env
file.
REACT_APP_COLOR=blue npx react-inject-env inject -d ./build -o ./build-blue
// the app will now have a blue background
npx http-server build-blue