# leapond-rollup-plugin-replace

> Rollup replace plugin with mixed finder support(String, RegExp).

Latest version **1.0.1** (published 2021-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install leapond-rollup-plugin-replace
pnpm add leapond-rollup-plugin-replace
yarn add leapond-rollup-plugin-replace
bun add leapond-rollup-plugin-replace
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-07-27 |
| First published | 2021-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 18.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leapond, Inc. |
| Maintainers | leapond |
| Keywords | rollup, plugin, replace, string, RegExp, mix, leapond |

## Links

- npm: https://www.npmjs.com/package/leapond-rollup-plugin-replace
- Repository: https://github.com/leapond/rollup-plugin-replace
- Homepage: https://github.com/leapond/rollup-plugin-replace#readme
- Issues: https://github.com/leapond/rollup-plugin-replace/issues
- npm.io page: https://npm.io/package/leapond-rollup-plugin-replace

## Dependencies (1)

- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^4.1.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-07-27
- 1.0.0 — 2021-07-26

## README

# leapond-rollup-plugin-replace

Rollup replace plugin with mixed finder support(String, RegExp).

## Installation

**NPM**

```shell
# for node(bundled)
npm i leapond-rollup-plugin-replace -D
# for web(esm)
npm i leapond-rollup-plugin-replace
```

**Yarn**

```shell
# for node(bundled)
yarn add leapond-rollup-plugin-replace -D
# for web
yarn add leapond-rollup-plugin-replace
```

## Usage

```javascript
import leapondReplace from "leapond-rollup-plugin-replace";

{
  //...
  plugins: [leapondReplace(options)]
  //... 
}
finder = 'abc'
finder = /a(b|d)c/, replacer = 'x$1x'

/*
Overloads:
leapondReplace(finder, replacer)
leapondReplace({rules: [[finder1, replacer2], [finder2, replacer2]...]})
 */
```

## Poison

```javascript
leapondReplace({
  LEAPOND: true,    // poison here
  rules: [[f1, r1]]
})
```

This poison will find & clean all Leapond's DEV comments:

```javascript
// removed sample 1
/*<DEV*/alert('some inline DEV code')/*DEV>*/

// removed sample 2
/*<DEV*/
/**
 * T
 * @param a
 * @param b
 * @return {*}
 */
function t(a, b) {
  return a + b
}

console.log(t(1, 2))
/*DEV>*/
```

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