@oazmi/superbuild - v0.3.2
    Preparing search index...

    Type Alias OnEmitCallback

    OnEmitCallback: (
        args: OnEmitArgs,
        output_file_registry: ReducedMetafile,
    ) => MaybePromiseOrNull<OnEmitResult>

    this is your onEmit hook function that gets called, if the handler associated with it allows a certain result from an onLoad hook to pass through its filter (OnEmitOptions).

    if your return value is nullable (null or undefined), then the next matching onEmit hook function will try to mutate the finalized loaded/transformed contents. if no emit hook returns a non-nullable after all matches have been made, then the transformed contents from the onTransform hook will be passed to esbuild as is.

    moreover, if the returned value declares OnEmitResult.reEmit as true, then the mutated emitted resource will once again pass through all registered onEmit handlers.

    Type Declaration

      • (
            args: OnEmitArgs,
            output_file_registry: ReducedMetafile,
        ): MaybePromiseOrNull<OnEmitResult>
      • Parameters

        • args: OnEmitArgs

          the description of the emitted file that is currently being processed/mutated by your callback function.

        • output_file_registry: ReducedMetafile

          this is a class instance of ReducedMetafile that lets you search for any output file entity, either by their output path-key, or by their input sources' resolved-paths.

          • the output path-key is the entity's initial output path. it can be simply computed as initialPath ?? outputPath for a given resource.
          • as for the sources' resolved-paths, they are defined as the { namespace: string, path: string } returned by the source's onResolve stage.
          • note that the file entities are strictly for read only purposes. do not even think of modifying them, otherwise bad things will happen. (i.e. sanata clause will die out of a heart attack, and L will get obliterated by truck-kun on the very first day he meats yagami.)

        Returns MaybePromiseOrNull<OnEmitResult>