Skip to content

Commit

Permalink
Merge pull request facebook#5348 from hzoo/patch-2
Browse files Browse the repository at this point in the history
add docs for babel 6
  • Loading branch information
zpao committed Oct 31, 2015
2 parents bbffc36 + 41fc5f2 commit 88bae3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/docs/09-tooling-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ If you like using JSX, Babel provides an [in-browser ES6 and JSX transformer for
### Productionizing: Precompiled JSX

If you have [npm](https://www.npmjs.com/), you can run `npm install -g babel`. Babel has built-in support for React v0.12 and v0.13. Tags are automatically transformed to their equivalent `React.createElement(...)`, `displayName` is automatically inferred and added to all React.createClass calls.
If you have [npm](https://www.npmjs.com/), you can run `npm install -g babel`. Babel has built-in support for React v0.12+. Tags are automatically transformed to their equivalent `React.createElement(...)`, `displayName` is automatically inferred and added to all React.createClass calls.

This tool will translate files that use JSX syntax to plain JavaScript files that can run directly in the browser. It will also watch directories for you and automatically transform files when they are changed; for example: `babel --watch src/ --out-dir lib/`.

> Note:
>
> If you are using babel 6.x, you will need to install the relevant preset/plugins. To get started, you can run `npm install -g babel babel-preset-react` and then run `babel --presets react --watch src/ --out-dir lib/`. For more information: check out the [babel 6 blog post](http://babeljs.io/blog/2015/10/29/6.0.0/)
By default JSX files with a `.js` extension are transformed. Run `babel --help` for more information on how to use Babel.

Example output:
Expand Down

0 comments on commit 88bae3f

Please sign in to comment.