1.0.7 • Published 1 year ago

esbuild-plugin-merge v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

esbuild-plugin-merge

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

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

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago

1.0.1

1 year ago