KC's Workspace
    Preparing search index...

    A filter to be used to do a pre-test to determine whether the hook should be called.

    See Plugin Hook Filters page for more details.

    interface HookFilter {
        code?: GeneralHookFilter<string | RegExp>;
        id?: GeneralHookFilter<string | RegExp>;
        moduleType?: ModuleTypeFilter;
    }
    Index

    Properties

    Properties

    code?: GeneralHookFilter<string | RegExp>

    A filter based on the module's code.

    Only available for transform hook.

    id?: GeneralHookFilter<string | RegExp>

    A filter based on the module id.

    If the value is a string, it is treated as a glob pattern. The string type is not available for resolveId hook.

    Include all ids that contain node_modules in the path.

    { id: '**'+'/node_modules/**' }
    

    Include all ids that contain node_modules or src in the path.

    { id: ['**'+'/node_modules/**', '**'+'/src/**'] }
    

    Include all ids that start with http

    { id: /^http/ }
    

    Exclude all ids that contain node_modules in the path.

    { id: { exclude: '**'+'/node_modules/**' } }
    

    Formal pattern to define includes and excludes.

    { id : {
    include: ['**'+'/foo/**', /bar/],
    exclude: ['**'+'/baz/**', /qux/]
    }}
    moduleType?: ModuleTypeFilter

    A filter based on the module's moduleType.

    Only available for transform hook.