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

    Interface OnTransformResult

    interface OnTransformResult {
        pluginName?: string;
        contents?: string | Uint8Array<ArrayBuffer>;
        loader?: any;
        pluginData?: any;
        emitData?: any;
        imports?: ImportEntity<any>[];
        errors?: PartialMessage[];
        warnings?: PartialMessage[];
        watchFiles?: string[];
        watchDirs?: string[];
    }
    Index

    Properties

    pluginName?: string

    insert your plugin's name to override the current plugin name that will be used for error printing.

    contents?: string | Uint8Array<ArrayBuffer>

    the transformed/transpiled contents that will be returned to esbuild.

    loader?: any

    if the contents needs to be transformed/minified natively by esbuild again (in addition to discovering additional imports), use one of the native loaders provided by esbuild.

    pluginData?: any

    insert plugin-data to be passed onto the dependencies' onResolve hook's arg.pluginData.

    if you wish to pass on the incoming OnTransformArgs.pluginData from the prior onLoad hook, you will need to explicitly pass it over as a return argument, otherwise the plugin-data will get lost. so, keep this in mind when designing transformation hooks, because you wouldn't want to ruin any plugin-data that some plugin was anticipating.

    emitData?: any

    pass some arbitrary data from the transformation stage to the emit stage.

    this feature is handled by SuperBuildContext.resolvedResourceRegistry.

    imports?: ImportEntity<any>[]

    specify arbitrary resource imports that must be performed for this resource.

    while these resources will get bundled (via dynamic imports performed by longBuildPluginSetup, so long as they are not marked with external: true), they (i.e. their output paths) won't get automatically incorporated into your contents; for that, you will have to use an SuperPluginBuild.onEmit hook to re-capture the output paths of the bundled imports specified here, and then re-incorporate those output paths into your OnEmitArgs.contents, using the non-mutating ImportEntity.key trace which resource is being referenced by the ImportedEntity.outputPath.

    to skip an import from being bundled, you can either stay silent about it (i.e. not include it here), or mark that import with external: true, so that it still gets passed to OnEmitArgs.imports, but will appear to esbuild as an external reference (and hence not resolved, nor bundled as an emitted output file).

    errors?: PartialMessage[]

    if any fatal error(s) occur during the transformation, pass it as a return value so that the build gets immediately halted.

    warnings?: PartialMessage[]

    if any warning(s) occur during the transformation, pass it as a return value so that esbuild prints out a warning immediately.

    watchFiles?: string[]

    add a list of local files to watch for mutation in order to trigger a reload of the original loader hook. (I think the paths need to be an absolute path.)

    any files added to this array will be combined with the OnLoadResult.watchFiles list of the prior onLoad hook function.

    watchDirs?: string[]

    add a list of directories to watch for mutation in order to trigger a reload. (I think the paths need to be an absolute path.)

    any directories added to this array will be combined with the OnLoadResult.watchDirs list of the prior onLoad hook function.