createPluginHookUtils() — vite Function Reference
Architecture documentation for the createPluginHookUtils() function in index.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD 8e5f0af2_5386_8a8f_0cb4_1863cc4b1cdf["createPluginHookUtils()"] 3bf7f0de_2a9f_6f04_cead_0321b3b7af01["index.ts"] 8e5f0af2_5386_8a8f_0cb4_1863cc4b1cdf -->|defined in| 3bf7f0de_2a9f_6f04_cead_0321b3b7af01 58c4a210_68fe_1b4d_ed49_d59203f97ef1["resolveConfig()"] 58c4a210_68fe_1b4d_ed49_d59203f97ef1 -->|calls| 8e5f0af2_5386_8a8f_0cb4_1863cc4b1cdf e09c4724_afb2_8289_1ee6_375b57d306ac["constructor()"] e09c4724_afb2_8289_1ee6_375b57d306ac -->|calls| 8e5f0af2_5386_8a8f_0cb4_1863cc4b1cdf a188e507_b323_f6f4_af53_0ba33b92284c["getSortedPluginsByHook()"] 8e5f0af2_5386_8a8f_0cb4_1863cc4b1cdf -->|calls| a188e507_b323_f6f4_af53_0ba33b92284c 58719e23_70bd_67e0_1ed8_f61c19ec725b["getHookHandler()"] 8e5f0af2_5386_8a8f_0cb4_1863cc4b1cdf -->|calls| 58719e23_70bd_67e0_1ed8_f61c19ec725b style 8e5f0af2_5386_8a8f_0cb4_1863cc4b1cdf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/node/plugins/index.ts lines 132–157
export function createPluginHookUtils(
plugins: readonly Plugin[],
): PluginHookUtils {
// sort plugins per hook
const sortedPluginsCache = new Map<keyof Plugin, Plugin[]>()
function getSortedPlugins<K extends keyof Plugin>(
hookName: K,
): PluginWithRequiredHook<K>[] {
if (sortedPluginsCache.has(hookName))
return sortedPluginsCache.get(hookName) as PluginWithRequiredHook<K>[]
const sorted = getSortedPluginsByHook(hookName, plugins)
sortedPluginsCache.set(hookName, sorted)
return sorted
}
function getSortedPluginHooks<K extends keyof Plugin>(
hookName: K,
): NonNullable<HookHandler<Plugin[K]>>[] {
const plugins = getSortedPlugins(hookName)
return plugins.map((p) => getHookHandler(p[hookName])).filter(Boolean)
}
return {
getSortedPlugins,
getSortedPluginHooks,
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does createPluginHookUtils() do?
createPluginHookUtils() is a function in the vite codebase, defined in packages/vite/src/node/plugins/index.ts.
Where is createPluginHookUtils() defined?
createPluginHookUtils() is defined in packages/vite/src/node/plugins/index.ts at line 132.
What does createPluginHookUtils() call?
createPluginHookUtils() calls 2 function(s): getHookHandler, getSortedPluginsByHook.
What calls createPluginHookUtils()?
createPluginHookUtils() is called by 2 function(s): constructor, resolveConfig.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free