From 438c872e64b0d611a65c171e08c55e0ac4744c32 Mon Sep 17 00:00:00 2001 From: gitanupam Date: Wed, 28 Dec 2016 16:24:00 +0530 Subject: [PATCH 1/2] Adding more info to the Install section It was confusing to see the Install command for babel-present-react again when the earlier command to install CLI also included babel-preset-react. Hence the edit. --- packages/babel-preset-react/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/babel-preset-react/README.md b/packages/babel-preset-react/README.md index 827160b246..57a51b2984 100644 --- a/packages/babel-preset-react/README.md +++ b/packages/babel-preset-react/README.md @@ -4,6 +4,8 @@ ## Install +(Note: Run the following command to install without the CLI (for example, if CLI is already installed)) + ```sh npm install --save-dev babel-preset-react ``` From fbeadc46eac3cba7eb7dc312d9fd9bb8f2440786 Mon Sep 17 00:00:00 2001 From: Sven SAULEAU Date: Wed, 28 Dec 2016 21:49:40 +0100 Subject: [PATCH 2/2] [skip ci] merge documentation with the website --- packages/babel-preset-react/README.md | 34 +++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/packages/babel-preset-react/README.md b/packages/babel-preset-react/README.md index 57a51b2984..aceb108aff 100644 --- a/packages/babel-preset-react/README.md +++ b/packages/babel-preset-react/README.md @@ -2,12 +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 -(Note: Run the following command to install without the CLI (for example, if CLI is already installed)) +> 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 '

Hello, world!

' > index.js +``` + +View the output + +```sh +./node_modules/.bin/babel index.js ``` ## Usage