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
{{ message }}
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: admin/README.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,8 +213,8 @@ To configure the syntax highlighting in your favorite text editor, head to the [
213
213
214
214
## Displaying Lint Output in the Editor
215
215
216
-
>Note: this feature is available with `[email protected]` and higher.<br>
217
-
>It also only works with npm 3 or higher.
216
+
>Note: this feature is available with `[email protected]` and higher.<br>
217
+
>It also only works with npm 3 or higher.
218
218
219
219
Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.
220
220
@@ -464,7 +464,7 @@ Then in `package.json`, add the following lines to `scripts`:
464
464
"test": "react-scripts test --env=jsdom",
465
465
```
466
466
467
-
>Note: To use a different preprocessor, replace `build-css` and `watch-css` commands according to your preprocessor’s documentation.
467
+
>Note: To use a different preprocessor, replace `build-css` and `watch-css` commands according to your preprocessor’s documentation.
468
468
469
469
Now you can rename `src/App.css` to `src/App.scss` and run `npm run watch-css`. The watcher will find every Sass file in `src` subdirectories, and create a corresponding CSS file next to it, in our case overwriting `src/App.css`. Since `src/App.js` still imports `src/App.css`, the styles become a part of your application. You can now edit `src/App.scss`, and `src/App.css` will be regenerated.
470
470
@@ -565,7 +565,7 @@ An alternative way of handling static assets is described in the next section.
565
565
566
566
## Using the `public` Folder
567
567
568
-
>Note: this feature is available with `[email protected]` and higher.
568
+
>Note: this feature is available with `[email protected]` and higher.
569
569
570
570
### Changing the HTML
571
571
@@ -586,7 +586,7 @@ This mechanism provides a number of benefits:
586
586
587
587
However there is an **escape hatch** that you can use to add an asset outside of the module system.
588
588
589
-
If you put a file into the `public` folder, it will **not** be processed by Webpack. Instead it will be copied into the build folder untouched. To reference assets in the `public` folder, you need to use a special variable called `PUBLIC_URL`.
589
+
If you put a file into the `public` folder, it will **not** be processed by Webpack. Instead it will be copied into the build folder untouched. To reference assets in the `public` folder, you need to use a special variable called `PUBLIC_URL`.
590
590
591
591
Inside `index.html`, you can use it like this:
592
592
@@ -701,15 +701,15 @@ To learn more about Flow, check out [its documentation](https://flowtype.org/).
701
701
702
702
## Adding Custom Environment Variables
703
703
704
-
>Note: this feature is available with `[email protected]` and higher.
704
+
>Note: this feature is available with `[email protected]` and higher.
705
705
706
706
Your project can consume variables declared in your environment as if they were declared locally in your JS files. By
707
707
default you will have `NODE_ENV` defined for you, and any other environment variables starting with
708
708
`REACT_APP_`.
709
709
710
710
**The environment variables are embedded during the build time**. Since Create React App produces a static HTML/CSS/JS bundle, it can’t possibly read them at runtime. To read them at runtime, you would need to load HTML into memory on the server and replace placeholders in runtime, just like [described here](#injecting-data-from-the-server-into-the-page). Alternatively you can rebuild the app on the server anytime you change them.
711
711
712
-
>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.
712
+
>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.
713
713
714
714
These environment variables will be defined for you on `process.env`. For example, having an environment
715
715
variable named `REACT_APP_SECRET_CODE` will be exposed in your JS as `process.env.REACT_APP_SECRET_CODE`.
@@ -764,7 +764,7 @@ When you compile the app with `npm run build`, the minification step will strip
764
764
765
765
### Referencing Environment Variables in the HTML
766
766
767
-
>Note: this feature is available with `[email protected]` and higher.
767
+
>Note: this feature is available with `[email protected]` and higher.
768
768
769
769
You can also access the environment variables starting with `REACT_APP_` in the `public/index.html`. For example:
### Adding Development Environment Variables In `.env`
800
800
801
-
>Note: this feature is available with `[email protected]` and higher.
801
+
>Note: this feature is available with `[email protected]` and higher.
802
802
803
803
To define permanent environment variables, create a file called `.env` in the root of your project:
804
804
@@ -810,7 +810,7 @@ REACT_APP_SECRET_CODE=abcdef
810
810
811
811
#### What other `.env` files are can be used?
812
812
813
-
>Note: this feature is **available with `[email protected]` and higher**.
813
+
>Note: this feature is **available with `[email protected]` and higher**.
814
814
815
815
*`.env`: Default.
816
816
*`.env.local`: Local overrides. **This file is loaded for all environments except test.**
@@ -826,7 +826,7 @@ Files on the left have more priority than files on the right:
826
826
These variables will act as the defaults if the machine does not explicitly set them.<br>
827
827
Please refer to the [dotenv documentation](https://github.com/motdotla/dotenv) for more details.
828
828
829
-
>Note: If you are defining environment variables for development, your CI and/or hosting platform will most likely need
829
+
>Note: If you are defining environment variables for development, your CI and/or hosting platform will most likely need
830
830
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).
831
831
832
832
## Can I Use Decorators?
@@ -862,7 +862,7 @@ You can find the companion GitHub repository [here](https://github.com/fullstack
862
862
863
863
## Proxying API Requests in Development
864
864
865
-
>Note: this feature is available with `[email protected]` and higher.
865
+
>Note: this feature is available with `[email protected]` and higher.
866
866
867
867
People often serve the front-end React app from the same host and port as their backend implementation.<br>
868
868
For example, a production setup might look like this after the app is deployed:
@@ -904,7 +904,7 @@ When you enable the `proxy` option, you opt into a more strict set of host check
904
904
905
905
This shouldn’t affect you when developing on `localhost`, but if you develop remotely like [described here](https://github.com/facebookincubator/create-react-app/issues/2271), you will see this error in the browser after enabling the `proxy` option:
906
906
907
-
>Invalid Host header
907
+
>Invalid Host header
908
908
909
909
To work around it, you can specify your public development host in a file called `.env.development` in the root of your project:
910
910
@@ -926,7 +926,7 @@ We don’t recommend this approach.
926
926
927
927
### Configuring the Proxy Manually
928
928
929
-
>Note: this feature is available with `[email protected]` and higher.
929
+
>Note: this feature is available with `[email protected]` and higher.
930
930
931
931
If the `proxy` option is **not** flexible enough for you, you can specify an object in the following form (in `package.json`).<br>
932
932
You may also specify any configuration value [`http-proxy-middleware`](https://github.com/chimurai/http-proxy-middleware#options) or [`http-proxy`](https://github.com/nodejitsu/node-http-proxy#options) supports.
@@ -984,7 +984,7 @@ You may also narrow down matches using `*` and/or `**`, to match the path exactl
984
984
985
985
## Using HTTPS in Development
986
986
987
-
>Note: this feature is available with `[email protected]` and higher.
987
+
>Note: this feature is available with `[email protected]` and higher.
988
988
989
989
You may require the dev server to serve pages over HTTPS. One particular case where this could be useful is when using [the "proxy" feature](#proxying-api-requests-in-development) to proxy requests to an API server when that API server is itself serving HTTPS.
990
990
@@ -1049,7 +1049,7 @@ Then, on the server, you can replace `__SERVER_DATA__` with a JSON of real data
1049
1049
1050
1050
## Running Tests
1051
1051
1052
-
>Note: this feature is available with `[email protected]` and higher.<br>
1052
+
>Note: this feature is available with `[email protected]` and higher.<br>
1053
1053
>[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)
1054
1054
1055
1055
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.
@@ -1198,7 +1198,7 @@ and then use them in your tests like you normally do.
1198
1198
1199
1199
### Initializing Test Environment
1200
1200
1201
-
>Note: this feature is available with `[email protected]` and higher.
1201
+
>Note: this feature is available with `[email protected]` and higher.
1202
1202
1203
1203
If your app uses a browser API that you need to mock in your tests or if you just need a global setup before running your tests, add a `src/setupTests.js` to your project. It will be automatically executed before running your tests.
1204
1204
@@ -1281,7 +1281,7 @@ CI=true npm run build
1281
1281
1282
1282
The test command will force Jest to run tests once instead of launching the watcher.
1283
1283
1284
-
> If you find yourself doing this often in development, please [file an issue](https://github.com/facebookincubator/create-react-app/issues/new) to tell us about your use case because we want to make watcher the best experience and are open to changing how it works to accommodate more workflows.
1284
+
> If you find yourself doing this often in development, please [file an issue](https://github.com/facebookincubator/create-react-app/issues/new) to tell us about your use case because we want to make watcher the best experience and are open to changing how it works to accommodate more workflows.
1285
1285
1286
1286
The build command will check for linter warnings and fail if any are found.
1287
1287
@@ -1561,7 +1561,7 @@ This will let Create React App correctly infer the root path to use in the gener
1561
1561
1562
1562
#### Serving the Same Build from Different Paths
1563
1563
1564
-
>Note: this feature is available with `[email protected]` and higher.
1564
+
>Note: this feature is available with `[email protected]` and higher.
1565
1565
1566
1566
If you are not using the HTML5 `pushState` history API or not using client-side routing at all, it is unnecessary to specify the URL from which your app will be served. Instead, you can put this in your `package.json`:
1567
1567
@@ -1638,7 +1638,7 @@ For more information see [Add Firebase to your JavaScript Project](https://fireb
1638
1638
1639
1639
### GitHub Pages
1640
1640
1641
-
>Note: this feature is available with `[email protected]` and higher.
1641
+
>Note: this feature is available with `[email protected]` and higher.
0 commit comments