patternToIdFilter() — vite Function Reference
Architecture documentation for the patternToIdFilter() function in pluginFilter.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD c1d1f930_a05f_b6cb_033a_4e928562c65e["patternToIdFilter()"] ed570918_8c20_047e_d700_db6178114e8f["pluginFilter.ts"] c1d1f930_a05f_b6cb_033a_4e928562c65e -->|defined in| ed570918_8c20_047e_d700_db6178114e8f 4cdadc30_895b_3584_a0e8_801554f99fbe["createIdFilter()"] 4cdadc30_895b_3584_a0e8_801554f99fbe -->|calls| c1d1f930_a05f_b6cb_033a_4e928562c65e f094d39d_cd97_2548_86c3_38902c2f3301["slash()"] c1d1f930_a05f_b6cb_033a_4e928562c65e -->|calls| f094d39d_cd97_2548_86c3_38902c2f3301 4851a5b1_b57c_b296_fcb9_09bf9e342db3["getMatcherString()"] c1d1f930_a05f_b6cb_033a_4e928562c65e -->|calls| 4851a5b1_b57c_b296_fcb9_09bf9e342db3 style c1d1f930_a05f_b6cb_033a_4e928562c65e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/node/plugins/pluginFilter.ts lines 36–55
function patternToIdFilter(
pattern: string | RegExp,
cwd: string,
): PluginFilter {
if (pattern instanceof RegExp) {
return (id: string) => {
const normalizedId = slash(id)
const result = pattern.test(normalizedId)
pattern.lastIndex = 0
return result
}
}
const glob = getMatcherString(pattern, cwd)
const matcher = picomatch(glob, { dot: true })
return (id: string) => {
const normalizedId = slash(id)
return matcher(normalizedId)
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does patternToIdFilter() do?
patternToIdFilter() is a function in the vite codebase, defined in packages/vite/src/node/plugins/pluginFilter.ts.
Where is patternToIdFilter() defined?
patternToIdFilter() is defined in packages/vite/src/node/plugins/pluginFilter.ts at line 36.
What does patternToIdFilter() call?
patternToIdFilter() calls 2 function(s): getMatcherString, slash.
What calls patternToIdFilter()?
patternToIdFilter() is called by 1 function(s): createIdFilter.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free