Skip to content

Commit 293dc1f

Browse files
committed
ctco-dev: update docs
1 parent 0ef93a0 commit 293dc1f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-scripts/template/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ These commands will run the container app and allow to see it on http://localhos
5151

5252
Environment variables filtered by mask (default mask is `WEB_APP_`) and injected into `window.env` at runtime in development mode (after `yarn start`) and in production mode (if running under docker with provided `.docker` scripts).
5353

54+
### Development
5455
To run project in dev mode and inject variables try to assign them in command line:
5556
```sh
5657
WEB_APP_ONE="hello my app" yarn start
5758
```
5859

60+
or add variables to `.env`, `.env.local`, `.env.development` et c. (see [Official CRA doc](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-development-environment-variables-in-env), but remember, only `WEB_APP_` prefixed variables will be injected into `window.env`).
61+
62+
### Production
5963
To inject environment variables into an application on starting a docker container:
6064
```sh
6165
docker run --rm -it --name my-cra-container -e "WEB_APP_ONE=\"hello my app\"" -p 8080:80 my-cra-image

0 commit comments

Comments
 (0)