@@ -283,7 +283,7 @@ class EnvironmentPluginContainer {
283
283
hookName : H ,
284
284
context : ( plugin : Plugin ) => ThisType < FunctionPluginHooks [ H ] > ,
285
285
args : ( plugin : Plugin ) => Parameters < FunctionPluginHooks [ H ] > ,
286
- condition ?: ( plugin : Plugin ) => boolean ,
286
+ condition ?: ( plugin : Plugin ) => boolean | undefined ,
287
287
) : Promise < void > {
288
288
const parallelPromises : Promise < unknown > [ ] = [ ]
289
289
for ( const plugin of this . getSortedPlugins ( hookName ) ) {
@@ -312,14 +312,16 @@ class EnvironmentPluginContainer {
312
312
return
313
313
}
314
314
this . _started = true
315
+ const config = this . environment . getTopLevelConfig ( )
315
316
this . _buildStartPromise = this . handleHookPromise (
316
317
this . hookParallel (
317
318
'buildStart' ,
318
319
( plugin ) => this . _getPluginContext ( plugin ) ,
319
320
( ) => [ this . options as NormalizedInputOptions ] ,
320
321
( plugin ) =>
321
322
this . environment . name === 'client' ||
322
- plugin . perEnvironmentStartEndDuringDev === true ,
323
+ config . server . perEnvironmentStartEndDuringDev ||
324
+ plugin . perEnvironmentStartEndDuringDev ,
323
325
) ,
324
326
) as Promise < void >
325
327
await this . _buildStartPromise
@@ -512,13 +514,15 @@ class EnvironmentPluginContainer {
512
514
if ( this . _closed ) return
513
515
this . _closed = true
514
516
await Promise . allSettled ( Array . from ( this . _processesing ) )
517
+ const config = this . environment . getTopLevelConfig ( )
515
518
await this . hookParallel (
516
519
'buildEnd' ,
517
520
( plugin ) => this . _getPluginContext ( plugin ) ,
518
521
( ) => [ ] ,
519
522
( plugin ) =>
520
523
this . environment . name === 'client' ||
521
- plugin . perEnvironmentStartEndDuringDev !== true ,
524
+ config . server . perEnvironmentStartEndDuringDev ||
525
+ plugin . perEnvironmentStartEndDuringDev ,
522
526
)
523
527
await this . hookParallel (
524
528
'closeBundle' ,
0 commit comments