onStart

Bun

Symbol

PluginBuilder.onStart

onStart(callback: OnStartCallback): this

Register a callback which will be invoked when bundling starts. When using hot module reloading, this is called at the start of each incremental rebuild.

@returns

this for method chaining

Bun.plugin({
  setup(builder) {
    builder.onStart(() => {
      console.log("bundle just started!!")
    });
  },
});

Referenced types

type OnStartCallback = () => void | Promise<void>