Loader's context

interface LoaderContext<T = Record<string, unknown>> {
    assets: Map<string, Uint8Array>;
    deps: Set<string>;
    id: string;
    options: T;
    plugin: PluginContext;
    sourceMap: false | { inline: boolean } & SourceMapOptions;
    warn: LoggingFunction;
}

Type Parameters

  • T = Record<string, unknown>

    type of loader's options

Properties

assets: Map<string, Uint8Array>

Assets to emit

deps: Set<string>

Files to watch

id: string

Resource path

options: T

Loader's options

{}
plugin: PluginContext
sourceMap: false | { inline: boolean } & SourceMapOptions

Options.sourceMap

warn: LoggingFunction