# babelrc-targeted-rollup

> Builds a babel configuration for rollup with specific targets from `babel-preset-env`

Latest version **0.1.2** (published 2017-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install babelrc-targeted-rollup
pnpm add babelrc-targeted-rollup
yarn add babelrc-targeted-rollup
bun add babelrc-targeted-rollup
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2017-09-11 |
| First published | 2017-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Donovan Lambert |
| Maintainers | donov4n |
| Keywords | rollup, babel, rollup-plugin-babel |

## Links

- npm: https://www.npmjs.com/package/babelrc-targeted-rollup
- Repository: https://github.com/Donov4n/babelrc-targeted-rollup
- Homepage: https://github.com/Donov4n/babelrc-targeted-rollup#readme
- Issues: https://github.com/Donov4n/babelrc-targeted-rollup/issues
- npm.io page: https://npm.io/package/babelrc-targeted-rollup

## Dependencies (1)

- [babelrc-rollup](https://npm.io/package/babelrc-rollup.md) ^3.0.0

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

- 0.1.2 (latest) — 2017-09-11
- 0.1.0 — 2017-06-29

## README

# babelrc-targeted-rollup

> Builds a babel configuration for rollup with specific targets from `babel-preset-env`.

## Installation

```bash
yarn add babelrc-targeted-rollup --dev
```

## Usage

Create a `.babelrc` containing the [`env` preset](https://github.com/babel/babel-preset-env).

```json
{
    "presets": [
        ["env", {
            "targets": {
                "node"     : 6,
                "browsers" : "Last 2 versions" 
            }
        }]
    ]
}
```

Then, in your `rollup.config.js`:

```js
import babelrc from 'babelrc-targeted-rollup';
import babel   from 'rollup-plugin-babel';

const baseOptions = {
    input    : 'src/my-package.js',
    external : ['lodash'],
    globals  : {
        'lodash': '_'
    }
};

const targets = [
    {
        output: {
            file   : 'dist/my-package.js',
            format : 'umd',
            name   : 'MyPackage'
        },
        plugins: [
            babel(babelrc('browsers'))
        ]
    },
    {
        output: {
            file   : 'dist/my-package.es.js',
            format : 'es'
        },
        plugins : [
            babel(babelrc('node'))
        ]
    }
];
export default targets.map(targetOptions => (
    Object.assign({}, baseOptions, targetOptions)
));
```

## Options

You can pass the same options as for [`babelrc-rollup`](https://github.com/eventualbuddha/babelrc-rollup#options) plus:

#### `targets` (default: `[]`)

The `babel-preset-env` targets you want to have inside the returned babel configuration.

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