# @10up/babel-preset-default

> 10up's default babel preset

Latest version **2.1.2** (published 2025-03-15) · 0 weekly downloads

## Install

```sh
npm install @10up/babel-preset-default
pnpm add @10up/babel-preset-default
yarn add @10up/babel-preset-default
bun add @10up/babel-preset-default
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

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

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2025-03-15 |
| First published | 2020-04-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 146 |
| Maintainers | fabiankaegy, brandwaffle, eugene-manuilov, christianc1, nicholasio, joesnellpdx, tlovett1, devinle, darylldoyle |
| Keywords | 10up, babel, preset |

## Links

- npm: https://www.npmjs.com/package/@10up/babel-preset-default
- Repository: https://github.com/10up/10up-toolkit
- Homepage: https://github.com/10up/10up-toolkit/tree/develop/packages/babel-preset-default#readme
- Issues: https://github.com/10up/10up-toolkit/issues
- npm.io page: https://npm.io/package/@10up/babel-preset-default

## Dependencies (10)

- [core-js](https://npm.io/package/core-js.md) ^3.35.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.23.7
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.23.7
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.23.7
- [@babel/preset-react](https://npm.io/package/@babel/preset-react.md) ^7.23.3
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.23.3
- [@babel/helper-plugin-utils](https://npm.io/package/@babel/helper-plugin-utils.md) ^7.22.5
- [@babel/plugin-transform-react-jsx](https://npm.io/package/@babel/plugin-transform-react-jsx.md) ^7.23.4
- [@wordpress/babel-plugin-import-jsx-pragma](https://npm.io/package/@wordpress/babel-plugin-import-jsx-pragma.md) ^4.31.0
- [babel-plugin-transform-react-remove-prop-types](https://npm.io/package/babel-plugin-transform-react-remove-prop-types.md) ^0.4.24

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.1.2 (latest) — 2025-03-15
- 3.0.0 (next) — 2026-09-07
- 3.0.0-next.0 — 2026-08-18
- 2.1.1 — 2024-03-11
- 2.1.1-next.0 — 2024-01-09
- 2.1.0 — 2023-05-16
- 2.0.4 — 2022-11-14
- 2.0.3 — 2022-06-06
- 2.0.3-next.1 — 2022-06-02
- 2.0.3-next.0 — 2022-05-16
- 2.0.2 — 2022-05-06
- 2.0.2-next.5 — 2022-04-27
- 2.0.2-next.4 — 2022-04-26
- 2.0.2-next.3 — 2022-04-26
- 2.0.2-next.2 — 2022-04-25
- … 17 more at https://npm.io/package/@10up/babel-preset-default/versions

## README

# 10up babel preset
Babel preset for transforming JavaScript at 10up.

[![Support Level](https://img.shields.io/badge/support-active-green.svg)](#support-level)

## Installation

```sh
npm install --save-dev @10up/babel-preset-default
```

## Usage

Simply add `@10up/babel-preset-default` to your `.babelrc` file
```json
// .babelrc
{
    "presets": [ "@10up/babel-preset-default"]
}
```

### Options
This babel preset exposes a few options. The default options are listed below.

```json
// .babelrc
{
    "presets": [
        ["@10up/babel-preset-default", {
            "modules": "auto",
            // defaults to true if modules is false and false otherwise.
            "runtimeESModules": false,
            "wordpress": false,
            "debug": false,
            "removePropTypes": {},
            "targets": [
                "> 1%",
                "ie >= 11",
                "last 2 versions",
                "Firefox ESR"
            ]
        }]
    ]
}
```

#### options.modules
It's the `@babel/preset-env` [modules](https://babeljs.io/docs/en/babel-preset-env#modules) setting. Default's to `auto` which will detect whether the "caller" (e.g webpack) has ES6 modules support and if so, will disable module transpilation (this is the desired behavior for tree-shaking for example);

#### options.wordpress
When enabled will load `@wordpress/babel-preset-default`. Required when building WordPress Gutenberg blocks.

#### options.debug
Enables debug messages. Useful to review which presets and plugins babel is using.

#### options.removePropTypes
By default this babel preset will remove any prop-types declarations when building for production.

You rarely will need to change this setting, but in case you do, this option let's you specify any of the [babel-plugin-transform-react-remove-prop-types](https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types) options. 

#### options.targets

Let's you specify which browser's are support. Set this option to `{}` if you want to leverage browserlist config sources (`.browserslistrc`). By default, the following browsers will be supported.

```json
[
    "> 1%",
    "ie >= 11",
    "last 2 versions",
    "Firefox ESR"
]
```

The appropriate `core-js` polyfills will be added automatically for those browsers.

### options.development
You can set this flag to enable or disable development mode, however, this preset will automatically detect that based on how it was loaded by the caller (e.g webpack).

## Support Level

**Active:** 10up is actively working on this, and we expect to continue work for the foreseeable future. Bug reports, feature requests, questions, and pull requests are welcome.

## Like what you see?

<a href="http://10up.com/contact/"><img src="https://10up.com/uploads/2016/10/10up-Github-Banner.png" width="850"></a>

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