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
+21-21
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
2
2
3
-
Below you will find some information on how to perform common tasks.
3
+
Below you will find some information on how to perform common tasks.<br>
4
4
You can find the most recent version of this guide [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md).
5
5
6
6
## Table of Contents
@@ -100,13 +100,13 @@ For the project to build, **these files must exist with exact filenames**:
100
100
101
101
You can delete or rename the other files.
102
102
103
-
You may create subdirectories inside `src`. For faster rebuilds, only files inside `src` are processed by Webpack.
103
+
You may create subdirectories inside `src`. For faster rebuilds, only files inside `src` are processed by Webpack.<br>
104
104
You need to **put any JS and CSS files inside `src`**, or Webpack won’t see them.
105
105
106
-
Only files inside `public` can be used from `public/index.html`.
106
+
Only files inside `public` can be used from `public/index.html`.<br>
107
107
Read instructions below for using assets from JavaScript and HTML.
108
108
109
-
You can, however, create more top-level directories.
109
+
You can, however, create more top-level directories.<br>
110
110
They will not be included in the production build so you can use them for things like documentation.
111
111
112
112
## Available Scripts
@@ -123,7 +123,7 @@ You will also see any lint errors in the console.
123
123
124
124
### `npm test`
125
125
126
-
Launches the test runner in the interactive watch mode.
126
+
Launches the test runner in the interactive watch mode.<br>
127
127
See the section about [running tests](#running-tests) for more information.
This project setup supports ES6 modules thanks to Babel.
192
+
This project setup supports ES6 modules thanks to Babel.<br>
193
193
While you can still use `require()` and `module.exports`, we encourage you to use [`import` and `export`](http://exploringjs.com/es6/ch_modules.html) instead.
194
194
195
195
For example:
@@ -337,7 +337,7 @@ Webpack finds all relative module references in CSS (they start with `./`) and r
337
337
338
338
Please be advised that this is also a custom feature of Webpack.
339
339
340
-
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).
340
+
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).<br>
341
341
An alternative way of handling static assets is described in the next section.
342
342
343
343
## Using the `public` Folder
@@ -517,22 +517,22 @@ To define permanent environment variables, create a file called `.env` in the ro
517
517
REACT_APP_SECRET_CODE=abcdef
518
518
```
519
519
520
-
These variables will act as the defaults if the machine does not explicitly set them.
520
+
These variables will act as the defaults if the machine does not explicitly set them.<br>
521
521
Please refer to the [dotenv documentation](https://github.com/motdotla/dotenv) for more details.
522
522
523
523
>Note: If you are defining environment variables for development, your CI and/or hosting platform will most likely need
524
524
these defined as well. Consult their documentation how to do this. For example, see the documentation for [Travis CI](https://docs.travis-ci.com/user/environment-variables/) or [Heroku](https://devcenter.heroku.com/articles/config-vars).
525
525
526
526
## Can I Use Decorators?
527
527
528
-
Many popular libraries use [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) in their documentation.
528
+
Many popular libraries use [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) in their documentation.<br>
529
529
Create React App doesn’t support decorator syntax at the moment because:
530
530
531
531
* It is an experimental proposal and is subject to change.
532
532
* The current specification version is not officially supported by Babel.
533
533
* If the specification changes, we won’t be able to write a codemod because we don’t use them internally at Facebook.
534
534
535
-
However in many cases you can rewrite decorator-based code without decorators just as fine.
535
+
However in many cases you can rewrite decorator-based code without decorators just as fine.<br>
@@ -548,7 +548,7 @@ Check out [this tutorial](https://www.fullstackreact.com/articles/using-create-r
548
548
549
549
>Note: this feature is available with `react-scripts@0.2.3` and higher.
550
550
551
-
People often serve the front-end React app from the same host and port as their backend implementation.
551
+
People often serve the front-end React app from the same host and port as their backend implementation.<br>
552
552
For example, a production setup might look like this after the app is deployed:
553
553
554
554
```
@@ -575,7 +575,7 @@ Fetch API cannot load http://localhost:4000/api/todos. No 'Access-Control-Allow-
575
575
576
576
Keep in mind that `proxy` only has effect in development (with `npm start`), and it is up to you to ensure that URLs like `/api/todos` point to the right thing in production. You don’t have to use the `/api` prefix. Any unrecognized request without a `text/html` accept header will be redirected to the specified `proxy`.
577
577
578
-
Currently the `proxy` option only handles HTTP requests, and it won’t proxy WebSocket connections.
578
+
Currently the `proxy` option only handles HTTP requests, and it won’t proxy WebSocket connections.<br>
579
579
If the `proxy` option is **not** flexible enough for you, alternatively you can:
580
580
581
581
* Enable CORS on your server ([here’s how to do it for Express](http://enable-cors.org/server_expressjs.html)).
@@ -623,7 +623,7 @@ If you use a Node server, you can even share the route matching logic between th
623
623
624
624
## Running Tests
625
625
626
-
>Note: this feature is available with `[email protected]` and higher.
626
+
>Note: this feature is available with `[email protected]` and higher.<br>
627
627
>[Read the migration guide to learn how to enable it in older projects!](https://github.com/facebookincubator/create-react-app/blob/master/CHANGELOG.md#migrating-from-023-to-030)
628
628
629
629
Create React App uses [Jest](https://facebook.github.io/jest/) as its test runner. To prepare for this integration, we did a [major revamp](https://facebook.github.io/jest/blog/2016/09/01/jest-15.html) of Jest so if you heard bad things about it years ago, give it another try.
@@ -677,7 +677,7 @@ it('sums numbers', () => {
677
677
});
678
678
```
679
679
680
-
All `expect()` matchers supported by Jest are [extensively documented here](http://facebook.github.io/jest/docs/api.html#expect-value).
680
+
All `expect()` matchers supported by Jest are [extensively documented here](http://facebook.github.io/jest/docs/api.html#expect-value).<br>
681
681
You can also use [`jest.fn()` and `expect(fn).toBeCalled()`](http://facebook.github.io/jest/docs/api.html#tobecalled) to create “spies” or mock functions.
@@ -838,7 +838,7 @@ By default, the `package.json` of the generated project looks like this:
838
838
}
839
839
```
840
840
841
-
If you know that none of your tests depend on [jsdom](https://github.com/tmpvar/jsdom), you can safely remove `--env=jsdom`, and your tests will run faster.
841
+
If you know that none of your tests depend on [jsdom](https://github.com/tmpvar/jsdom), you can safely remove `--env=jsdom`, and your tests will run faster.<br>
842
842
To help you make up your mind, here is a list of APIs that **need jsdom**:
843
843
844
844
* Any browser globals like `window` and `document`
@@ -863,7 +863,7 @@ This feature is experimental and still [has major usage issues](https://github.c
863
863
864
864
## Building for Relative Paths
865
865
866
-
By default, Create React App produces a build assuming your app is hosted at the server root.
866
+
By default, Create React App produces a build assuming your app is hosted at the server root.<br>
867
867
To override this, specify the `homepage` in your `package.json`, for example:
868
868
869
869
```js
@@ -882,7 +882,7 @@ Open your `package.json` and add a `homepage` field:
882
882
"homepage": "http://myusername.github.io/my-app",
883
883
```
884
884
885
-
**The above step is important!**
885
+
**The above step is important!**<br>
886
886
Create React App uses the `homepage` field to determine the root URL in the built HTML file.
887
887
888
888
Now, whenever you run `npm run build`, you will see a cheat sheet with a sequence of commands to deploy to GitHub pages:
@@ -905,7 +905,7 @@ Note that GitHub Pages doesn't support routers that use the HTML5 `pushState` hi
905
905
906
906
### Heroku
907
907
908
-
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).
908
+
Use the [Heroku Buildpack for Create React App](https://github.com/mars/create-react-app-buildpack).<br>
909
909
You can find instructions in [Deploying React with Zero Configuration](https://blog.heroku.com/deploying-react-with-zero-configuration).
0 commit comments