# modify-babel-preset

> Create a modified babel preset based on an an existing preset.

Latest version **3.2.1** (published 2017-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install modify-babel-preset
pnpm add modify-babel-preset
yarn add modify-babel-preset
bun add modify-babel-preset
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.1 |
| Published | 2017-01-17 |
| First published | 2016-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 86 |
| Author | Jason Miller |
| Maintainers | developit |
| Keywords | babel, preset |

## Links

- npm: https://www.npmjs.com/package/modify-babel-preset
- Repository: https://github.com/developit/modify-babel-preset
- Homepage: https://github.com/developit/modify-babel-preset#readme
- Issues: https://github.com/developit/modify-babel-preset/issues
- npm.io page: https://npm.io/package/modify-babel-preset

## Dependencies (1)

- [require-relative](https://npm.io/package/require-relative.md) ^0.8.7

## 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

- 3.2.1 (latest) — 2017-01-17
- 2.0.1 (beta) — 2016-03-29
- 3.2.0 — 2016-10-14
- 3.1.0 — 2016-09-07
- 3.0.0 — 2016-08-13
- 2.1.1 — 2016-08-05
- 2.1.0 — 2016-07-22
- 2.0.3 — 2016-06-21
- 2.0.2 — 2016-04-16
- 2.0.0 — 2016-03-29
- 1.2.0 — 2016-01-25
- 1.1.3 — 2016-01-25
- 1.1.2 — 2016-01-25
- 1.1.1 — 2016-01-25
- 1.1.0 — 2016-01-24
- … 1 more at https://npm.io/package/modify-babel-preset/versions

## README

# modify-babel-preset

[![npm](https://img.shields.io/npm/v/modify-babel-preset.svg)](http://npm.im/modify-babel-preset)
[![npm](https://img.shields.io/npm/dm/modify-babel-preset.svg)](http://npm.im/modify-babel-preset)
[![travis](https://travis-ci.org/developit/modify-babel-preset.svg?branch=master)](https://travis-ci.org/developit/modify-babel-preset)


Create a modified babel preset based on an an existing preset.

> Works best with `npm 3`.


```sh
npm i -S modify-babel-preset
```


---


- [API](#api)
	- [Add/Update Plugins](#addupdate-plugins)
	- [Remove Plugins](#remove-plugins)
- [Example](#example)


  ---


## API

A single function that takes an existing preset name and a mapping of plugin modifications to apply to that preset.  _Make sure you have the preset and any added plugins installed as dependencies._

```js
newPreset = modifyBabelPreset(
	'existing-preset-name',
	{
		'plugin-name': false,  // remove
		'other-plugin': true,  // add
		'foo': { loose:true }  // add + config
	}
);
```

> Modification keys are babel plugin names _(you can exclude the `babel-plugin-` prefix)._


### Add/Update Plugins

To add a plugin, pass `true`, or a configuration object:

```js
{
	// just add a plugin without config:
	'plugin-name': true,

	// add a plugin and set its config
	'other-plugin': { loose:true }
}
```

> **Note:** adding a plugin that is already provided by the preset just overwrites its configuration.


### Remove Plugins

To remove a plugin, pass `false`:

```js
{
	'plugin-name': false
}
```


---


## Example

Here's a simple preset. Just this `index.js` and a package.json pointing to it with the preset and plugin installed as dependencies.

```js
var modifyBabelPreset = require('modify-babel-preset');

// just export the cloned, modified preset config:
module.exports = modifyBabelPreset('es2015', {

	// remove the typeof x==='symbol' transform:
	'transform-es2015-typeof-symbol': false,

	// add the JSX transform:
	'transform-react-jsx': true

});
```

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