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: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ null ?? 'some other default'; // result: 'some other default'
35
35
false ?? true; // result: false
36
36
```
37
37
38
-
**If your're using TypeScript, you will need to upgrade your `typescript` dependency to `3.7.0` or later if you wish to use the new operators.**
38
+
**If you're using TypeScript, you will need to upgrade your `typescript` dependency to `3.7.0` or later if you wish to use the new operators.**
39
39
40
40
**If you're using Visual Studio Code 1.40 (the latest as of this release) or earlier, you will need to configure your editor if you want it to understand the new operators.**
Copy file name to clipboardExpand all lines: README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ npx create-react-app my-app
16
16
cd my-app
17
17
npm start
18
18
```
19
+
If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that npx always uses the latest version.
19
20
20
21
_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_
21
22
@@ -61,7 +62,7 @@ _`npm init <initializer>` is available in npm 6+_
61
62
yarn create react-app my-app
62
63
```
63
64
64
-
_`yarn create` is available in Yarn 0.25+_
65
+
_[`yarn create <starter-kit-package>`](https://yarnpkg.com/lang/en/docs/cli/create/) is available in Yarn 0.25+_
65
66
66
67
It will create a directory called `my-app` inside the current folder.<br>
67
68
Inside that directory, it will generate the initial project structure and install the transitive dependencies:
@@ -196,6 +197,8 @@ We'd love to have your helping hand on `create-react-app`! See [CONTRIBUTING.md]
196
197
This project exists thanks to all the people who [contribute](CONTRIBUTING.md).<br>
Copy file name to clipboardExpand all lines: docusaurus/docs/custom-templates.md
+22-7Lines changed: 22 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ Custom Templates enable you to select a template to create your project from, wh
9
9
10
10
You'll notice that Custom Templates are always named in the format `cra-template-[template-name]`, however you only need to provide the `[template-name]` to the creation command.
11
11
12
+
Scoped templates are also supported, under the name `@[scope-name]/cra-template` or `@[scope-name]/cra-template-[template-name]`, which can be installed via `@[scope]` and `@[scope]/[template-name]` respectively.
@@ -58,18 +60,31 @@ You can add whatever files you want in here, but you must have at least the file
58
60
59
61
### The `template.json` file
60
62
61
-
This is where you can define dependencies (only dependencies are supported for now), as well as any custom scripts that your template relies on.
63
+
This is the configuration file for your template. As this is a new feature, more options will be added over time. For now, only a `package` key is supported.
64
+
65
+
The `package` key lets you provide any keys/values that you want added to the new project's `package.json`, such as dependencies (only dependencies are supported for now) and any custom scripts that your template relies on.
66
+
67
+
Below is an example `template.json` file:
62
68
63
69
```json
64
70
{
65
-
"dependencies": {
66
-
"serve": "^11.2.0"
67
-
},
68
-
"scripts": {
69
-
"serve": "serve -s build",
70
-
"build-and-serve": "npm run build && npm run serve"
71
+
"package": {
72
+
"dependencies": {
73
+
"eslint-plugin-jsx-a11y": "^6.2.3",
74
+
"serve": "^11.2.0"
75
+
},
76
+
"scripts": {
77
+
"serve": "serve -s build",
78
+
"build-and-serve": "npm run build && npm run serve"
Any values you add for `"dependencies"` and `"scripts"` will be merged with the Create React App defaults. Values for any other keys will be used as-is, replacing any matching Create React App defaults.
89
+
75
90
For convenience, we always replace `npm run` with `yarn` in your custom `"scripts"`, as well as in your `README` when projects are initialized with yarn.
Copy file name to clipboardExpand all lines: docusaurus/docs/making-a-progressive-web-app.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ the build process will generate a service worker file, but it will not be
10
10
registered, so it will not take control of your production web app.
11
11
12
12
In order to opt-in to the offline-first behavior, developers should look for the
13
-
following in their [`src/index.js`](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/src/index.js) file:
13
+
following in their [`src/index.js`](https://github.com/facebook/create-react-app/blob/master/packages/cra-template/template/src/index.js) file:
14
14
15
15
```js
16
16
// If you want your app to work offline and load faster, you can change
@@ -62,7 +62,7 @@ following into account:
62
62
fetched the latest updates that will be available the next time they load the
63
63
page (showing a "New content is available once existing tabs are closed." message). Showing
64
64
these messages is currently left as an exercise to the developer, but as a
65
-
starting point, you can make use of the logic included in [`src/serviceWorker.js`](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/src/serviceWorker.js), which
65
+
starting point, you can make use of the logic included in [`src/serviceWorker.js`](https://github.com/facebook/create-react-app/blob/master/packages/cra-template/template/src/serviceWorker.js), which
66
66
demonstrates which service worker lifecycle events to listen for to detect each
67
67
scenario, and which as a default, only logs appropriate messages to the
68
68
JavaScript console.
@@ -93,11 +93,11 @@ following into account:
93
93
## Progressive Web App Metadata
94
94
95
95
The default configuration includes a web app manifest located at
96
-
[`public/manifest.json`](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/public/manifest.json), that you can customize with
96
+
[`public/manifest.json`](https://github.com/facebook/create-react-app/blob/master/packages/cra-template/template/public/manifest.json), that you can customize with
97
97
details specific to your web application.
98
98
99
99
When a user adds a web app to their homescreen using Chrome or Firefox on
100
-
Android, the metadata in [`manifest.json`](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/public/manifest.json) determines what
100
+
Android, the metadata in [`manifest.json`](https://github.com/facebook/create-react-app/blob/master/packages/cra-template/template/public/manifest.json) determines what
101
101
icons, names, and branding colors to use when the web app is displayed.
102
102
[The Web App Manifest guide](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/)
103
103
provides more context about what each field means, and how your customizations
Copy file name to clipboardExpand all lines: docusaurus/docs/supported-browsers-features.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,6 @@ Here is an example `browserslist` that is specified in `package.json`:
50
50
}
51
51
```
52
52
53
-
> Note that this does not include polyfills automatically for you. You will still need to polyfill language features (see above) as needed based on the browsers your are supporting.
53
+
> Note that this does not include polyfills automatically for you. You will still need to polyfill language features (see above) as needed based on the browsers you are supporting.
54
54
55
-
> When editing the `browserslist` config, you may notice that your changes don't get picked up right away. This is due to an [issue in babel-loader](https://github.com/babel/babel-loader/issues/690) not detecting the change in your `package.json`. An quick solution is to delete the `node_modules/.cache` folder and try again.
55
+
> When editing the `browserslist` config, you may notice that your changes don't get picked up right away. This is due to an [issue in babel-loader](https://github.com/babel/babel-loader/issues/690) not detecting the change in your `package.json`. A quick solution is to delete the `node_modules/.cache` folder and try again.
0 commit comments