MCPcopy
hub / github.com/rollup/rollup / hookFirst

Method hookFirst

src/utils/PluginDriver.ts:141–150  ·  view source on GitHub ↗
(
		hookName: H,
		parameters: Parameters<FunctionPluginHooks[H]>,
		replaceContext?: ReplaceContext | null,
		skipped?: ReadonlySet<Plugin> | null
	)

Source from the content-addressed store, hash-verified

139
140 // chains, first non-null result stops and returns
141 hookFirst<H extends AsyncPluginHooks & FirstPluginHooks>(
142 hookName: H,
143 parameters: Parameters<FunctionPluginHooks[H]>,
144 replaceContext?: ReplaceContext | null,
145 skipped?: ReadonlySet<Plugin> | null
146 ): Promise<ReturnType<FunctionPluginHooks[H]> | null> {
147 return this.hookFirstAndGetPlugin(hookName, parameters, replaceContext, skipped).then(
148 result => result && result[0]
149 );
150 }
151
152 // chains, first non-null result stops and returns result and last plugin
153 async hookFirstAndGetPlugin<H extends AsyncPluginHooks & FirstPluginHooks>(

Callers 2

addModuleSourceMethod · 0.80
resolveDynamicImportMethod · 0.80

Calls 1

hookFirstAndGetPluginMethod · 0.95

Tested by

no test coverage detected