Skip to content

Commit 4fc36f6

Browse files
committed
[docs] Update Getting Started for babel 6
1 parent d37a072 commit 4fc36f6

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

docs/docs/getting-started.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ ReactDOM.render(
3030
To install React DOM and build your bundle after installing browserify:
3131

3232
```sh
33-
$ npm install --save react react-dom
34-
$ browserify -t babelify main.js -o bundle.js
33+
$ npm install --save react react-dom babelify babel-preset-react
34+
$ browserify -t [ babelify --presets [ react ] ] main.js -o bundle.js
3535
```
3636

37+
> Note:
38+
>
39+
> If you are using ES2015, you will want to also use the `babel-preset-es2015` package.
40+
41+
3742
## Quick Start Without npm
3843

3944
If you're not ready to use npm yet, you can download the starter kit which includes prebuilt copies of React and React DOM.
@@ -94,16 +99,20 @@ Note that some browsers (Chrome, e.g.) will fail to load the file unless it's se
9499
First install the [Babel](http://babeljs.io/) command-line tools (requires [npm](https://www.npmjs.com/)):
95100

96101
```
97-
npm install --global babel
102+
npm install --global babel-cli
103+
npm install babel-preset-react
98104
```
99105

100106
Then, translate your `src/helloworld.js` file to plain JavaScript:
101107

102108
```
103-
babel src --watch --out-dir build
104-
109+
babel --presets react src --watch --out-dir build
105110
```
106111

112+
> Note:
113+
>
114+
> If you are using ES2015, you will want to also use the `babel-preset-es2015` package.
115+
107116
The file `build/helloworld.js` is autogenerated whenever you make a change. Read the [Babel CLI documentation](http://babeljs.io/docs/usage/cli/) for more advanced usage.
108117

109118
```javascript{2}

0 commit comments

Comments
 (0)