From d1c0c23adfe750f2a20559120268e375f876e5f2 Mon Sep 17 00:00:00 2001 From: Mae Capozzi Date: Mon, 8 Jan 2018 17:31:43 -0500 Subject: [PATCH] Update README.md (#3717) * Update README.md with a note that reminds users to prepend REACT_APP_ to their environment variables. * Based on #865, where Dan Abramov suggests the person who filed the issue create a PR with these changes. * Took the language from [Adding Custom Environment Variables](https://github.com/facebookincubator/create-react-app/tree/master/packages/react-scripts/template#adding-custom-environment-variables) --- packages/react-scripts/template/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 157073b74b3..287a0134e95 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -944,6 +944,7 @@ To define permanent environment variables, create a file called `.env` in the ro ``` REACT_APP_SECRET_CODE=abcdef ``` +>Note: You must create custom environment variables beginning with `REACT_APP_`. Any other variables except `NODE_ENV` will be ignored to avoid [accidentally exposing a private key on the machine that could have the same name](https://github.com/facebookincubator/create-react-app/issues/865#issuecomment-252199527). Changing any environment variables will require you to restart the development server if it is running. `.env` files **should be** checked into source control (with the exclusion of `.env*.local`).