OnLoadArgs

Bun

Symbol

OnLoadArgs

interface OnLoadArgs

  • defer: () => Promise<void>

    Defer the execution of this callback until all other modules have been parsed.

  • loader: Loader

    The default loader for this file extension

  • namespace: string

    The namespace of the module being loaded

  • path: string

    The resolved import specifier of the module being loaded

    builder.onLoad({ filter: /^hello:world$/ }, (args) => {
      console.log(args.path); // "hello:world"
      return { exports: { foo: "bar" }, loader: "object" };
    });