# babel-preset-react-app

> Babel preset used by Create React App

Latest version **10.1.0** (published 2025-02-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-preset-react-app
pnpm add babel-preset-react-app
yarn add babel-preset-react-app
bun add babel-preset-react-app
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 10.1.0 |
| Published | 2025-02-15 |
| First published | 2016-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Unpacked size | 20.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 103258 |
| Maintainers | fb, timer, iansu, ianschmitz, rickhanlonii |

## Links

- npm: https://www.npmjs.com/package/babel-preset-react-app
- Repository: https://github.com/facebook/create-react-app
- Homepage: https://github.com/facebook/create-react-app#readme
- Issues: https://github.com/facebook/create-react-app/issues
- npm.io page: https://npm.io/package/babel-preset-react-app

## Dependencies (17)

- [@babel/core](https://npm.io/package/@babel/core.md) ^7.16.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.16.3
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.16.4
- [@babel/preset-react](https://npm.io/package/@babel/preset-react.md) ^7.16.0
- [babel-plugin-macros](https://npm.io/package/babel-plugin-macros.md) ^3.1.0
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.16.0
- [@babel/plugin-transform-runtime](https://npm.io/package/@babel/plugin-transform-runtime.md) ^7.16.4
- [@babel/plugin-proposal-decorators](https://npm.io/package/@babel/plugin-proposal-decorators.md) ^7.16.4
- [@babel/plugin-proposal-private-methods](https://npm.io/package/@babel/plugin-proposal-private-methods.md) ^7.16.0
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.16.0
- [@babel/plugin-proposal-numeric-separator](https://npm.io/package/@babel/plugin-proposal-numeric-separator.md) ^7.16.0
- [@babel/plugin-proposal-optional-chaining](https://npm.io/package/@babel/plugin-proposal-optional-chaining.md) ^7.16.0
- [@babel/plugin-transform-flow-strip-types](https://npm.io/package/@babel/plugin-transform-flow-strip-types.md) ^7.16.0
- [@babel/plugin-transform-react-display-name](https://npm.io/package/@babel/plugin-transform-react-display-name.md) ^7.16.0
- [babel-plugin-transform-react-remove-prop-types](https://npm.io/package/babel-plugin-transform-react-remove-prop-types.md) ^0.4.24
- [@babel/plugin-proposal-private-property-in-object](https://npm.io/package/@babel/plugin-proposal-private-property-in-object.md) ^7.16.7
- [@babel/plugin-proposal-nullish-coalescing-operator](https://npm.io/package/@babel/plugin-proposal-nullish-coalescing-operator.md) ^7.16.0

## Recent versions

- 10.1.0 (latest) — 2025-02-15
- 10.1.0-next.43 (next) — 2025-02-14
- 9.1.0-next.61 (canary) — 2019-10-24
- 10.1.0-next.14 — 2022-04-12
- 10.0.1 — 2021-12-14
- 11.0.0-next.104 — 2021-12-14
- 11.0.0-next.103 — 2021-12-14
- 11.0.0-next.102 — 2021-12-08
- 11.0.0-next.101 — 2021-12-08
- 11.0.0-next.91 — 2021-10-04
- 11.0.0-next.81 — 2021-09-01
- 11.0.0-next.75 — 2021-08-04
- 10.0.0 — 2020-10-23
- 10.0.0-next.117 — 2020-10-23
- 10.0.0-next.116 — 2020-10-23
- … 69 more at https://npm.io/package/babel-preset-react-app/versions

## README

# babel-preset-react-app

This package includes the Babel preset used by [Create React App](https://github.com/facebook/create-react-app).<br>
Please refer to its documentation:

- [Getting Started](https://facebook.github.io/create-react-app/docs/getting-started) – How to create a new app.
- [User Guide](https://facebook.github.io/create-react-app/) – How to develop apps bootstrapped with Create React App.

## Usage in Create React App Projects

The easiest way to use this configuration is with [Create React App](https://github.com/facebook/create-react-app), which includes it by default. **You don’t need to install it separately in Create React App projects.**

## Usage Outside of Create React App

If you want to use this Babel preset in a project not built with Create React App, you can install it with the following steps.

First, [install Babel](https://babeljs.io/docs/setup/).

Then install babel-preset-react-app.

```sh
npm install babel-preset-react-app --save-dev
```

Then create a file named `.babelrc` with following contents in the root folder of your project:

```json
{
  "presets": ["react-app"]
}
```

This preset uses the `useBuiltIns` option with [transform-object-rest-spread](https://babeljs.io/docs/plugins/transform-object-rest-spread/) and [transform-react-jsx](https://babeljs.io/docs/plugins/transform-react-jsx/), which assumes that `Object.assign` is available or polyfilled.

## Usage with Flow

Make sure you have a `.flowconfig` file at the root directory. You can also use the `flow` option on `.babelrc`:

```json
{
  "presets": [["react-app", { "flow": true, "typescript": false }]]
}
```

## Usage with TypeScript

Make sure you have a `tsconfig.json` file at the root directory. You can also use the `typescript` option on `.babelrc`:

```json
{
  "presets": [["react-app", { "flow": false, "typescript": true }]]
}
```

## Absolute Runtime Paths

Absolute paths are enabled by default for imports. To use relative paths instead, set the `absoluteRuntime` option in `.babelrc` to `false`:

```
{
  "presets": [["react-app", { "absoluteRuntime": false }]]
}
```

---
_Source: https://npm.io/package/babel-preset-react-app · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
