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

Hierarchy (view full)

Properties

addWatchFile: ((id) => void)

Type declaration

    • (id): void
    • Parameters

      • id: string

      Returns void

emitFile: EmitFile
error: ((error, pos?) => never)

Type declaration

    • (error, pos?): never
    • Parameters

      • error: string | RollupError
      • Optional pos: number | {
            column: number;
            line: number;
        }

      Returns never

getCombinedSourcemap: (() => SourceMap)

Type declaration

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