# unassert-rollup-plugin

> Unassert Rollup plugin

Latest version **2.0.0** (published 2022-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install unassert-rollup-plugin
pnpm add unassert-rollup-plugin
yarn add unassert-rollup-plugin
bun add unassert-rollup-plugin
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-08-06 |
| First published | 2022-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 7 |
| Unpacked size | 443.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Birk Skyum |
| Maintainers | birkskyum |
| Keywords | plugin, rollup, unassert |

## Links

- npm: https://www.npmjs.com/package/unassert-rollup-plugin
- Repository: https://github.com/birkskyum/unassert-rollup-plugin
- Issues: https://github.com/birkskyum/unassert-rollup-plugin/issues
- npm.io page: https://npm.io/package/unassert-rollup-plugin

## Dependencies (7)

- [acorn](https://npm.io/package/acorn.md) ^8.8.0
- [unassert](https://npm.io/package/unassert.md) ^2.0.0
- [escodegen](https://npm.io/package/escodegen.md) ^2.0.0
- [convert-source-map](https://npm.io/package/convert-source-map.md) ^1.8.0
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^4.2.1
- [multi-stage-sourcemap](https://npm.io/package/multi-stage-sourcemap.md) ^0.3.1
- [acorn-import-assertions](https://npm.io/package/acorn-import-assertions.md) ^1.8.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.0 (latest) — 2022-08-06
- 1.0.15 — 2022-08-06
- 1.0.14 — 2022-08-06
- 1.0.13 — 2022-08-06
- 1.0.12 — 2022-08-06
- 1.0.11 — 2022-08-06
- 1.0.10 — 2022-08-06
- 1.0.9 — 2022-08-06
- 1.0.8 — 2022-08-06
- 1.0.7 — 2022-08-06
- 1.0.6 — 2022-08-06
- 1.0.5 — 2022-08-06
- 1.0.4 — 2022-08-06
- 1.0.3 — 2022-08-06
- 1.0.2 — 2022-08-06
- … 2 more at https://npm.io/package/unassert-rollup-plugin/versions

## README

# unassert-rollup-plugin

A [Rollup](http://www.rollupjs.org) plugin to remove assertion calls via [Unassert](https://github.com/unassert-js/unassert).


## Install

`npm i -D unassert-rollup-plugin`

`yarn add -D unassert-rollup-plugin`

## Usage

Add it to the `plugins` section of your Rollup config as follows:

```ts
import {unassert} from 'unassert-rollup-plugin';

export default {
    ...
    plugins: [
        unassert()
    ]
};
```

### Available options

This plugin accepts the following options:

* `include`: A minimatch pattern or array of minimatch patterns, controlling which files are to be handled by this plugin. By default matches `*.js` only.
* `exclude`: A minimatch pattern or array of minimatch patterns, controlling which files are to be ignored by this plugin. By default it's empty.
* `sourcemap`: A boolean controlling whether to handle any existing sourcemaps, defaults to `true`. Setting this to `false` will hide the assert calls when debugging the generated bundle.
* `assertionPatterns`: as per [unassert options](https://github.com/unassert-js/unassert#options).
* `requirePatterns`: as per [unassert options](https://github.com/unassert-js/unassert#options).
* `importPatterns`: as per [unassert options](https://github.com/unassert-js/unassert#options).

### Example Rollup config

```ts
import unassert from 'unassert-rollup-plugin';

export default {
    input: 'src/index.js',
    output: {
        file: 'dist/my-lib.js',
    },
    plugins: [
        unassert({
            exclude: 'test/**/**.js',
            requirePatterns: ['assert = require("assert")']
        })
    ]
};
```

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