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: README.md
+56-5Lines changed: 56 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# React CLI
1
+
# Create React App
2
2
3
3
A new blessed “getting started” experience for building SPAs in React that we can actually ship.
4
4
@@ -18,21 +18,72 @@ Make it easy to get started with React.
18
18
19
19
This is a hard constraint. We are committed to having zero configuration in the project.
20
20
21
-
If you use `react-cli`, you should have `src/index.js`, your bundle will be compiled to `dist/`, and it will run at http://localhost:3000 in development. You can’t change this.
21
+
If you use `create-react-app`, you should have `src/index.js`, your bundle will be compiled to `build/index.html`, and it will run at http://localhost:3000 in development. You can’t change this.
22
22
23
23
It will have Babel, ESLint, Autprefixr and some other stuff we think it useful for getting started, but you won’t be exposed to it, and won’t be able to configure it. We curate the setup completely.
24
24
25
25
### Exit Strategy
26
26
27
-
You can say goodbye to `react-cli` at any time. Type `react-cli export`, and it will create the configs and replace the generated `scripts` in `package.json` with the equivalent "real thing" (e.g. `webpack-dev-server` and `webpack` calls). You're on your own now.
27
+
You can say goodbye to `create-react-app` at any time. Type `npm run export-scripts`, and it will create the configs and replace the generated `scripts` in `package.json` with the equivalent "real thing" (e.g. `webpack-dev-server` and `webpack` calls). You're on your own now.
28
28
29
29
This is why "zero configuration" can work as a constraint. We can punt on many real-world features (code splitting, Google Analytics, custom Babel plugins) because we let you leave the "getting started" experience any time.
30
30
31
-
This makes React CLI a feasible way to get started with a "real" React project without learning the tools. Once you export, you can't go back.
31
+
This makes Create React App a feasible way to get started with a "real" React project without learning the tools. Once you export, you can't go back.
32
32
33
33
### One Dependency
34
34
35
-
It works like `react-native-cli`. There is just one thing in your `devDependencies`, and it hides Babel, ESLint, and all the other stuff. But as I wrote above, you can `react-cli export` at any time.
35
+
It works like `react-native-cli`. There is just one thing in your `devDependencies`, and it hides Babel, ESLint, and all the other stuff. But as I wrote above, you can `npm run exports-scripts` at any time.
36
36
37
+
## How to use
37
38
39
+
Install once:
40
+
41
+
```bash
42
+
npm install -g create-react-app
43
+
```
44
+
45
+
When creating a new app:
46
+
47
+
```
48
+
create-react-app my-app
49
+
cd my-app
50
+
npm start
51
+
```
52
+
53
+
Done!
54
+
55
+
If you want to build it for production
56
+
57
+
```
58
+
npm run build
59
+
```
60
+
61
+
and if you want to tweak it
62
+
63
+
```
64
+
npm run exports-scripts # Beware, this is a one-way operation, can't go back!
65
+
```
66
+
67
+
## How to develop it
68
+
69
+
You first need to
70
+
71
+
```
72
+
npm install
73
+
```
74
+
75
+
Once it is done, you can modify any file locally and do
76
+
77
+
```
78
+
npm start
79
+
npm run build
80
+
```
81
+
82
+
If you want to try out the end to end flow with the global cli
0 commit comments