@@ -205,15 +205,14 @@ export class Config implements IConfig {
205205 }
206206 }
207207
208- async runHook < T > ( event : string , opts : T ) {
208+ async runHook < T > ( event : string , opts : T ) : Promise < any > {
209209 debug ( 'start %s hook' , event )
210-
211210 const search = ( m : any ) : Hook < T > => {
212211 if ( typeof m === 'function' ) return m
213212 if ( m . default && typeof m . default === 'function' ) return m . default
214213 return Object . values ( m ) . find ( ( m : any ) => typeof m === 'function' ) as Hook < T >
215214 }
216-
215+ const results = [ ]
217216 for ( const p of this . plugins ) {
218217 const debug = require ( 'debug' ) ( [ this . bin , p . name , 'hooks' , event ] . join ( ':' ) )
219218 const context : Hook . Context = {
@@ -242,8 +241,8 @@ export class Config implements IConfig {
242241
243242 debug ( 'start' , isESM ? '(import)' : '(require)' , filePath )
244243
245- await search ( module ) . call ( context , { ...opts as any , config : this } )
246- /* eslint-enable no-await-in-loop */
244+ const result = await search ( module ) . call ( context , { ...opts as any , config : this } )
245+ results . push ( result )
247246
248247 debug ( 'done' )
249248 } catch ( error ) {
@@ -254,6 +253,7 @@ export class Config implements IConfig {
254253 }
255254
256255 debug ( '%s hook done' , event )
256+ return results
257257 }
258258
259259 async runCommand < T = unknown > ( id : string , argv : string [ ] = [ ] , cachedCommand ?: Command . Plugin ) : Promise < T > {
0 commit comments