Merge pull request #5051 from gitanupam/patch-1
Adding more info to the Install section
This commit is contained in:
commit
b443f3e158
@ -2,10 +2,42 @@
|
||||
|
||||
> Babel preset for all React plugins.
|
||||
|
||||
This preset includes the following plugins:
|
||||
|
||||
- [syntax-flow](https://babeljs.io/docs/plugins/syntax-flow/)
|
||||
- [syntax-jsx](https://babeljs.io/docs/plugins/syntax-jsx/)
|
||||
- [transform-flow-strip-types](https://babeljs.io/docs/plugins/transform-flow-strip-types/)
|
||||
- [transform-react-jsx](https://babeljs.io/docs/plugins/transform-react-jsx/)
|
||||
- [transform-react-display-name](https://babeljs.io/docs/plugins/transform-react-display-name/)
|
||||
|
||||
## Install
|
||||
|
||||
> You can also check out the React [Getting Started page](https://facebook.github.io/react/docs/hello-world.html)
|
||||
|
||||
> For more info, check out the setup page on the [cli](/docs/setup/) and the [usage](/docs/usage/cli/) docs.
|
||||
|
||||
Install the CLI and this preset
|
||||
|
||||
```sh
|
||||
npm install --save-dev babel-preset-react
|
||||
npm install --save-dev babel-cli babel-preset-react
|
||||
```
|
||||
|
||||
Make a .babelrc config file with the preset
|
||||
|
||||
```sh
|
||||
echo '{ "presets": ["react"] }' > .babelrc
|
||||
```
|
||||
|
||||
Create a file to run on
|
||||
|
||||
```sh
|
||||
echo '<h1>Hello, world!</h1>' > index.js
|
||||
```
|
||||
|
||||
View the output
|
||||
|
||||
```sh
|
||||
./node_modules/.bin/babel index.js
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user