# esbuild-plugin-merge

> merge esbuild plugins and provide rollup features

Latest version **1.0.7** (published 2023-03-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install esbuild-plugin-merge
pnpm add esbuild-plugin-merge
yarn add esbuild-plugin-merge
bun add esbuild-plugin-merge
```

## 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 | 1.0.7 |
| Published | 2023-03-23 |
| First published | 2023-03-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | fgsreally |

## Links

- npm: https://www.npmjs.com/package/esbuild-plugin-merge
- npm.io page: https://npm.io/package/esbuild-plugin-merge

## Dependencies (2)

- [esbuild](https://npm.io/package/esbuild.md) ~0.16.17
- [chokidar](https://npm.io/package/chokidar.md) ^3.5.3

## Recent versions

- 1.0.7 (latest) — 2023-03-23
- 1.0.6 — 2023-03-05
- 1.0.5 — 2023-03-05
- 1.0.4 — 2023-03-05
- 1.0.3 — 2023-03-02
- 1.0.2 — 2023-03-02
- 1.0.0 — 2023-03-01
- 1.0.1 — 2023-03-01

## README

## esbuild-plugin-merge

merge esbuild plugins and provide rollup features (`watchChange`,`transform`,`enforce` ) for plugin

```ts
import { merge, pre, ProPlugin } from "esbuild-plugin-merge";

let pluginA: ProPlugin = {
  name: "pluginA",
  enforce: "post",//like vite
  setup(build) {
    initOptions = build.initialOptions;

    //esbuild
    build.onResolve({ filter: /\.css/ }, (args) => {
      //...
    });
    build.onLoad({ filter: /\.css/ }, async (args) => {
      //...
    });

    // like rollup/vite
    build.onTransform({ filter: /\.css/ }, (loadres,args) => {
      //...
    });
    build.onUpdate((args) => {
      //...
    });
  },
};

const ret = await build({
  //...
  plugins: [merge([ build, pre(pluginB/**other esbuild plugin */)])],
});
```


 it depends on `watch` property in initOptions.
 not support esbuild^0.17.x

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