interface PluginContext {
    addWatchFile: ((id) => void);
    cache: PluginCache;
    debug: LoggingFunction;
    emitFile: EmitFile;
    error: ((error) => never);
    getFileName: ((fileReferenceId) => string);
    getModuleIds: (() => IterableIterator<string>);
    getModuleInfo: GetModuleInfo;
    getWatchFiles: (() => string[]);
    info: LoggingFunction;
    load: ((options) => Promise<ModuleInfo>);
    meta: PluginContextMeta;
    parse: ParseAst;
    resolve: ((source, importer?, options?) => Promise<null | ResolvedId>);
    setAssetSource: ((assetReferenceId, source) => void);
    warn: LoggingFunction;
}

Hierarchy (view full)

Properties

addWatchFile: ((id) => void)

Type declaration

    • (id): void
    • Parameters

      • id: string

      Returns void

emitFile: EmitFile
error: ((error) => never)

Type declaration

    • (error): never
    • Parameters

      Returns never

getFileName: ((fileReferenceId) => string)

Type declaration

    • (fileReferenceId): string
    • Parameters

      • fileReferenceId: string

      Returns string

getModuleIds: (() => IterableIterator<string>)

Type declaration

getModuleInfo: GetModuleInfo
getWatchFiles: (() => string[])

Type declaration

    • (): string[]
    • Returns string[]

load: ((options) => Promise<ModuleInfo>)

Type declaration

parse: ParseAst
resolve: ((source, importer?, options?) => Promise<null | ResolvedId>)

Type declaration

    • (source, importer?, options?): Promise<null | ResolvedId>
    • Parameters

      • source: string
      • Optional importer: string
      • Optional options: {
            attributes?: Record<string, string>;
            custom?: CustomPluginOptions;
            isEntry?: boolean;
            skipSelf?: boolean;
        }
        • Optional attributes?: Record<string, string>
        • Optional custom?: CustomPluginOptions
        • Optional isEntry?: boolean
        • Optional skipSelf?: boolean

      Returns Promise<null | ResolvedId>

setAssetSource: ((assetReferenceId, source) => void)

Type declaration

    • (assetReferenceId, source): void
    • Parameters

      • assetReferenceId: string
      • source: string | Uint8Array

      Returns void