MonEnd
Bun

method

PluginBuilder.onEnd

callback: OnEndCallback
): this;

Register a callback which will be invoked when bundling ends. This is called after all modules have been bundled and the build is complete.

@returns

this for method chaining

const plugin: Bun.BunPlugin = {
  name: "my-plugin",
  setup(builder) {
    builder.onEnd((result) => {
      console.log("bundle just finished!!", result);
    });
  },
};

Referenced types

type OnEndCallback = (result: BuildOutput) => void | Promise<void>