Commit 2c80f43f authored by Christopher Chedeau's avatar Christopher Chedeau
Browse files

Tweak README with the new naming + add instructions

parent 9642700a
Showing with 56 additions and 5 deletions
+56 -5
# React CLI # Create React App
A new blessed “getting started” experience for building SPAs in React that we can actually ship. A new blessed “getting started” experience for building SPAs in React that we can actually ship.
...@@ -18,21 +18,72 @@ Make it easy to get started with React. ...@@ -18,21 +18,72 @@ Make it easy to get started with React.
This is a hard constraint. We are committed to having zero configuration in the project. This is a hard constraint. We are committed to having zero configuration in the project.
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. 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.
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. 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.
### Exit Strategy ### Exit Strategy
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. 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.
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. 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.
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. 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.
### One Dependency ### One Dependency
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. 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.
## How to use
Install once:
```bash
npm install -g create-react-app
```
When creating a new app:
```
create-react-app my-app
cd my-app
npm start
```
Done!
If you want to build it for production
```
npm run build
```
and if you want to tweak it
```
npm run exports-scripts # Beware, this is a one-way operation, can't go back!
```
## How to develop it
You first need to
```
npm install
```
Once it is done, you can modify any file locally and do
```
npm start
npm run build
```
If you want to try out the end to end flow with the global cli
```
npm run create-react-app my-app
cd my-app
npm run
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment