You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/react-scripts/template/README.md
+11-7
Original file line number
Diff line number
Diff line change
@@ -495,7 +495,7 @@ Now you are ready to use the imported React Bootstrap components within your com
495
495
496
496
Flow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept.
497
497
498
-
Recent versions of [Flow](http://flowtype.org/) work with Create React App projects out of the box.
498
+
Recent versions of [Flow](http://flowtype.org/) work with Create React App projects out of the box.
499
499
500
500
To add Flow to a Create React App project, follow these steps:
501
501
@@ -515,7 +515,11 @@ To learn more about Flow, check out [its documentation](https://flowtype.org/).
515
515
516
516
Your project can consume variables declared in your environment as if they were declared locally in your JS files. By
517
517
default you will have `NODE_ENV` defined for you, and any other environment variables starting with
518
-
`REACT_APP_`. These environment variables will be defined for you on `process.env`. For example, having an environment
518
+
`REACT_APP_`.
519
+
520
+
>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).
521
+
522
+
These environment variables will be defined for you on `process.env`. For example, having an environment
519
523
variable named `REACT_APP_SECRET_CODE` will be exposed in your JS as `process.env.REACT_APP_SECRET_CODE`, in addition
520
524
to `process.env.NODE_ENV`.
521
525
@@ -623,12 +627,12 @@ These tutorials will help you to integrate your app with an API backend running
623
627
using `fetch()` to access it.
624
628
625
629
### Node
626
-
Check out [this tutorial](https://www.fullstackreact.com/articles/using-create-react-app-with-a-server/).
630
+
Check out [this tutorial](https://www.fullstackreact.com/articles/using-create-react-app-with-a-server/).
627
631
You can find the companion GitHub repository [here](https://github.com/fullstackreact/food-lookup-demo).
628
632
629
633
### Ruby on Rails
630
634
631
-
Check out [this tutorial](https://www.fullstackreact.com/articles/how-to-get-create-react-app-to-work-with-your-rails-api/).
635
+
Check out [this tutorial](https://www.fullstackreact.com/articles/how-to-get-create-react-app-to-work-with-your-rails-api/).
632
636
You can find the companion GitHub repository [here](https://github.com/fullstackreact/food-lookup-demo-rails).
633
637
634
638
## Proxying API Requests in Development
@@ -961,7 +965,7 @@ Snapshot testing is a feature of Jest that automatically generates text snapshot
961
965
962
966
### Editor Integration
963
967
964
-
If you use [Visual Studio Code](https://code.visualstudio.com), there is a [Jest extension](https://github.com/orta/vscode-jest) which works with Create React App out of the box. This provides a lot of IDE-like features while using a text editor: showing the status of a test run with potential fail messages inline, starting and stopping the watcher automatically, and offering one-click snapshot updates.
968
+
If you use [Visual Studio Code](https://code.visualstudio.com), there is a [Jest extension](https://github.com/orta/vscode-jest) which works with Create React App out of the box. This provides a lot of IDE-like features while using a text editor: showing the status of a test run with potential fail messages inline, starting and stopping the watcher automatically, and offering one-click snapshot updates.
965
969
966
970

967
971
@@ -1196,15 +1200,15 @@ GitHub Pages doesn't support routers that use the HTML5 `pushState` history API
1196
1200
### Heroku
1197
1201
1198
1202
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).<br>
1199
-
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
1203
+
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
1200
1204
1201
1205
#### Resolving "Module not found: Error: Cannot resolve 'file' or 'directory'"
1202
1206
1203
1207
Sometimes `npm run build` works locally but fails during deploy via Heroku with an error like this:
1204
1208
1205
1209
```
1206
1210
remote: Failed to create a production build. Reason:
1207
-
remote: Module not found: Error: Cannot resolve 'file' or 'directory'
1211
+
remote: Module not found: Error: Cannot resolve 'file' or 'directory'
0 commit comments