Skip to content

Commit 7a02f9a

Browse files
authored
readme: Add Advanced Configuration (#1515)
* Add Advanced Configuration section * Reference package.json instead * Add HOST, HTTPS, and CI * Switch wording from Amazon to a CDN * Add test runner comment * Add top-level README link * Simplify wording * Link to relevant docs * Link to apps * Add .env link * Simpler links * Add a CI flag note
1 parent 8e127aa commit 7a02f9a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ The [User Guide](https://github.com/facebookincubator/create-react-app/blob/mast
124124
- [Developing Components in Isolation](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#developing-components-in-isolation)
125125
- [Making a Progressive Web App](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#making-a-progressive-web-app)
126126
- [Deployment](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#deployment)
127+
- [Advanced Configuration](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#advanced-configuration)
127128
- [Troubleshooting](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#troubleshooting)
128129

129130
A copy of the user guide will be created as `README.md` in your project folder.

packages/react-scripts/template/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
6363
- [Now](#now)
6464
- [S3 and CloudFront](#s3-and-cloudfront)
6565
- [Surge](#surge)
66+
- [Advanced Configuration](#advanced-configuration)
6667
- [Troubleshooting](#troubleshooting)
6768
- [`npm start` doesn’t detect changes](#npm-start-doesnt-detect-changes)
6869
- [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
@@ -1289,6 +1290,19 @@ Install the Surge CLI if you haven't already by running `npm install -g surge`.
12891290
12901291
Note that in order to support routers that use HTML5 `pushState` API, you may want to rename the `index.html` in your build folder to `200.html` before deploying to Surge. This [ensures that every URL falls back to that file](https://surge.sh/help/adding-a-200-page-for-client-side-routing).
12911292
1293+
## Advanced Configuration
1294+
1295+
You can adjust various development and production settings by setting environment variables in your shell or with [.env](#adding-development-environment-variables-in-env).
1296+
1297+
Variable | Development | Production | Usage
1298+
:--- | :---: | :---: | :---
1299+
BROWSER | :white_check_mark: | :x: | By default, Create React App will open the default system browser, favoring Chrome on macOS. Specify a [browser](https://github.com/sindresorhus/opn#app) to override this behavior, or set it to `none` to disable it completely.
1300+
HOST | :white_check_mark: | :x: | By default, the development web server binds to `localhost`. You may use this variable to specify a different host.
1301+
PORT | :white_check_mark: | :x: | By default, the development web server will attempt to listen on port 3000 or prompt you to attempt the next available port. You may use this variable to specify a different port.
1302+
HTTPS | :white_check_mark: | :x: | When set to `true`, Create React App will run the development server in `https` mode.
1303+
PUBLIC_URL | :x: | :white_check_mark: | Create React App assumes your application is hosted at the serving web server's root or a subpath as specified in [`package.json` (`homepage`)](#building-for-relative-paths). Normally, Create React App ignores the hostname. You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included). This may be particularly useful when using a CDN to host your application.
1304+
CI | :large_orange_diamond: | :white_check_mark: | When set to `true`, Create React App treats warnings as failures in the build. It also makes the test runner non-watching. Most CIs set this flag by default.
1305+
12921306
## Troubleshooting
12931307

12941308
### `npm start` doesn’t detect changes

0 commit comments

Comments
 (0)