Skip to content

Commit

Permalink
Tweak section on expanding env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jan 15, 2018
1 parent 12d0544 commit 95b2601
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,17 +980,20 @@ these defined as well. Consult their documentation how to do this. For example,

#### Expanding Environment Variables In `.env`

>Note: this feature is available with `react-scripts@1.0.18` and higher.
>Note: this feature is available with `react-scripts@1.1.0` and higher.
Expand variables already on your machine for use in your .env file (using [dotenv-expand](https://github.com/motdotla/dotenv-expand)). See [#2223](https://github.com/facebookincubator/create-react-app/issues/2223).
Expand variables already on your machine for use in your `.env` file (using [dotenv-expand](https://github.com/motdotla/dotenv-expand)).

For example, to get the environment variable `npm_package_version`:

```
REACT_APP_VERSION=$npm_package_version
# also works:
# REACT_APP_VERSION=${npm_package_version}
```

Or expand variables local to the current `.env` file:

```
DOMAIN=www.example.com
REACT_APP_FOO=$DOMAIN/foo
Expand Down

0 comments on commit 95b2601

Please sign in to comment.