Skip to content

Commit

Permalink
add documentation about custom babel configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tuchk4 committed Jan 6, 2017
1 parent ff0da30 commit 0b6a5f3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ prompt(
);

// Add Babel config if there is no local babel config
if (isLocalBabelExists()) {
if (!isLocalBabelExists()) {
console.log(' Adding ' + cyan('Babel') + ' preset');
appPackage.babel = babelConfig;
}
Expand Down
3 changes: 0 additions & 3 deletions packages/react-scripts/template/.babelrc

This file was deleted.

13 changes: 13 additions & 0 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
- [Using Global Variables](#using-global-variables)
- [Adding Bootstrap](#adding-bootstrap)
- [Adding Flow](#adding-flow)
- [Adding Custom Babel Configuration](#adding-custom-babel-configuration)
- [Adding Custom Environment Variables](#adding-custom-environment-variables)
- [Can I Use Decorators?](#can-i-use-decorators)
- [Integrating with a Node Backend](#integrating-with-a-node-backend)
Expand Down Expand Up @@ -494,6 +495,18 @@ In the future we plan to integrate it into Create React App even more closely.

To learn more about Flow, check out [its documentation](https://flowtype.org/).

## Adding Custom Babel Configuration

You can override builtin babel presets and plugins [via .babelrc or package.json](https://babeljs.io/docs/usage/babelrc/).

>Note: Don't forget to install babel-preset-react-app and include "react-app" preset into your .babelrc or package.json babel configuration section.
```js
{
"presets": ["react-app", "stage-0"]
}
```

## Adding Custom Environment Variables

>Note: this feature is available with `[email protected]` and higher.
Expand Down

0 comments on commit 0b6a5f3

Please sign in to comment.