Skip to content

Interface: HookFilter

Properties

code?


id?

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

Examples

Include all ids that contain node_modules in the path.

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

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

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

Include all ids that start with http

js
{ id: /^http/ }

Exclude all ids that contain node_modules in the path.

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

Formal pattern to define includes and excludes.

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

moduleType?

Released under the MIT License.