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

    Interface OnTransformArgs

    interface OnTransformArgs {
        path: string;
        namespace: string;
        loader: any;
        suffix: string;
        contents: string | Uint8Array<ArrayBuffer>;
        pluginData: any;
        resolveDir: string;
        with: Record<string, string>;
    }
    Index

    Properties

    path: string

    the resolved path of the contents.

    namespace: string

    the namespace inherited from the onLoad hook (which gets inherited from the onResolve hook).

    loader: any

    the loader that is supposed to be used for this contents for the transformation.

    suffix: string

    any url-suffix string that is present in the path.

    contents: string | Uint8Array<ArrayBuffer>

    the loaded content that is to be transformed.

    pluginData: any

    the plugin data returned by the onLoad hook.

    Important

    esbuild strips away any plugin-data when it resolves/loads natively. hence, in order to preserve it during native loading, we might have to instill a "file" namespace loader that will capture all native loading cases, and then perform the loading ourselves, followed by preserving the plugin-data.

    TODO: actually, right now, I'm intentionally stripping away the pluginData in my "native loader". I'll have to see how much of an inconvenience it becomes before I give in to preserving the plugin-data. otherwise, if I can manage to write plugins without needing this feature, then there's no reason to add it.

    resolveDir: string

    the resolveDir (used for node-resolution) returned by the loader.

    Note

    when the onLoad hook function returns an empty/undefined resolveDir, this value turns into an empty string.

    with: Record<string, string>

    the with attribute argument passed to the onLoad hook.