# @choseohwan/rollup-builder

> Easier configuration of rollup settings

Latest version **2.0.3** (published 2022-10-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install @choseohwan/rollup-builder
pnpm add @choseohwan/rollup-builder
yarn add @choseohwan/rollup-builder
bun add @choseohwan/rollup-builder
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2022-10-09 |
| First published | 2021-06-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 27.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wtae1216 |
| Maintainers | wtae1216 |
| Keywords | rollup |

## Links

- npm: https://www.npmjs.com/package/@choseohwan/rollup-builder
- Repository: https://github.com/ChoSeoHwan/library
- Homepage: https://github.com/ChoSeoHwan/library/blob/main/packages/rollup-builder/README.md
- Issues: https://github.com/ChoSeoHwan/library/issues
- npm.io page: https://npm.io/package/@choseohwan/rollup-builder

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.19.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2022-10-09
- 2.0.3-next.d645c42f722fa4dd4c6c9858569155469a888b75.0 — 2022-10-09
- 2.0.2 — 2022-09-22
- 2.0.2-next.c3261f7740aedc8c02aa5f2a760371c8c134ccc7.0 — 2022-09-22
- 2.0.1 — 2022-09-22
- 2.0.1-next.ddd377a5375440e1c6c72fc7e7ec779fa8aaaedc.0 — 2022-09-22
- 2.0.1-alpha-57.f665119773b026d111a262bdbe62a9d3e7c853f4.0 — 2022-09-22
- 1.1.8 — 2022-06-18
- 1.1.8-next.19b49d8d8aaf3967365fcf1b3562179a824b8876.0 — 2022-06-18
- 1.1.8-alpha-40.4ff49b20fae98d0fb5951161cb0e5aa7d9fdd0db.0 — 2022-06-18
- 1.1.7 — 2021-11-12
- 1.1.7-next.8f420769d87f13f116c3c84c5ea713e0f060496a.0 — 2021-11-12
- 1.1.7-alpha-36.db5639d6d7198e6cf9eb4898f24973990ad76be3.0 — 2021-11-12
- 1.1.6 — 2021-10-19
- 1.1.6-next.2ada46e30e7ff52b3b1c40453fdd4ca775892585.0 — 2021-10-19
- … 41 more at https://npm.io/package/@choseohwan/rollup-builder/versions

## README

# `@choseohwan/rollup-builder`

rollup builder for rollup config easier

## Install

### npm
```shell
npm install @choseohwan/rollup-builder --save-dev
```

### yarn
```shell
yarn add @choseohwan/rollup-builder -D
```

## Usage

###  Overall usage example

`rollup.config.js`
```javascript
import buildRollupOptions, {Input, OutputBuilder, Plugin, Plugins} from '@choseohwan/rollup-builder';
import cleaner from "rollup-plugin-cleaner";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
// another imports...

// makes input object (rollup config's input option)
const input = new Input(
    {
        index: 'src/index.ts',
        option: 'src/option/index.ts',
        builder: 'src/builder/index.ts'
    },
    {
        umd: 'src/index.ts'
    }
);

// makes output builder
const outputBuilder = new OutputBuilder({
    sourcemap: true
});

// makes plugins object 
const cleanerPlugin = new Plugin(
    'rollup-builder-cleaner',
    cleaner,
    (output) => [
        {
            targets: [output.getOutputDir()]
        }
    ]
);

const peerDepsExternals = new Plugin(
    'rollup-plugin-peer-deps-external',
    peerDepsExternal,
    []
);

const plugins = new Plugins(
    cleanerPlugin,
    peerDepsExternals,
    // ...
);

// make rollup options with options
export default buildRollupOptions(
    input,
    [
        outputBuilder.buildES({
            dir: 'dist/esm'
        }),
        outputBuilder.buildCJS({
            dir: 'dist/cjs'
        }),
        outputBuilder.buildUMD('common', {
            dir: 'dist/umd'
        })
    ],
    plugins
);
```

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