F

find

Finds a module matching a filter. Lazy unless { lazy: false } is passed, or all is set: the search runs on first access.

function find(filter: MetroFilter, options?: MetroSearchOptions): any

Parameters

NameTypeDescription
filterMetroFilter

The filter to match modules against: a built-in, a combination, or a predicate you write, which the build keys for the cache.

options?MetroSearchOptions

Search options controlling interop, caching, esModule unwrapping, and all.

Returns

any

The matched module, an array of matches when all is set, undefined when the cache knows it is missing, or null.