Loader

interface Loader<T = Record<string, unknown>> {
    alwaysProcess?: boolean;
    name: string;
    process: (
        this: LoaderContext<T>,
        payload: Payload,
    ) => Payload | Promise<Payload>;
    test?: RegExp | (file: string) => boolean;
}

Type Parameters

  • T = Record<string, unknown>

    type of loader's options

Properties

alwaysProcess?: boolean

Skip testing, always process the file

name: string

Name

process: (
    this: LoaderContext<T>,
    payload: Payload,
) => Payload | Promise<Payload>

Function for processing

test?: RegExp | (file: string) => boolean

Test to control if file should be processed. Also used for plugin's supported files test.