@@ -296,6 +296,7 @@ export function buildWebpackBrowser(
296
296
297
297
return { success } ;
298
298
} else {
299
+ const processResults : ProcessBundleResult [ ] = [ ] ;
299
300
const bundleInfoStats : BundleStats [ ] = [ ] ;
300
301
outputPaths = ensureOutputPaths ( baseOutputPath , i18n ) ;
301
302
@@ -445,7 +446,6 @@ export function buildWebpackBrowser(
445
446
446
447
const processActions : typeof actions = [ ] ;
447
448
let processRuntimeAction : ProcessBundleOptions | undefined ;
448
- const processResults : ProcessBundleResult [ ] = [ ] ;
449
449
for ( const action of actions ) {
450
450
// If SRI is enabled always process the runtime bundle
451
451
// Lazy route integrity values are stored in the runtime bundle
@@ -598,22 +598,6 @@ export function buildWebpackBrowser(
598
598
const asset = webpackStats . assets ?. find ( a => a . name === chunk . files [ 0 ] ) ;
599
599
bundleInfoStats . push ( generateBundleStats ( { ...chunk , size : asset ?. size } ) ) ;
600
600
}
601
-
602
- // Check for budget errors and display them to the user.
603
- const budgets = options . budgets || [ ] ;
604
- const budgetFailures = checkBudgets ( budgets , webpackStats , processResults ) ;
605
- for ( const { severity, message } of budgetFailures ) {
606
- switch ( severity ) {
607
- case ThresholdSeverity . Warning :
608
- webpackStats . warnings . push ( message ) ;
609
- break ;
610
- case ThresholdSeverity . Error :
611
- webpackStats . errors . push ( message ) ;
612
- break ;
613
- default :
614
- assertNever ( severity ) ;
615
- }
616
- }
617
601
} else {
618
602
files = emittedFiles . filter ( x => x . name !== 'polyfills-es5' ) ;
619
603
noModuleFiles = emittedFiles . filter ( x => x . name === 'polyfills-es5' ) ;
@@ -636,6 +620,24 @@ export function buildWebpackBrowser(
636
620
}
637
621
}
638
622
623
+ // Check for budget errors and display them to the user.
624
+ const budgets = options . budgets ;
625
+ if ( budgets ?. length ) {
626
+ const budgetFailures = checkBudgets ( budgets , webpackStats , processResults ) ;
627
+ for ( const { severity, message } of budgetFailures ) {
628
+ switch ( severity ) {
629
+ case ThresholdSeverity . Warning :
630
+ webpackStats . warnings . push ( message ) ;
631
+ break ;
632
+ case ThresholdSeverity . Error :
633
+ webpackStats . errors . push ( message ) ;
634
+ break ;
635
+ default :
636
+ assertNever ( severity ) ;
637
+ }
638
+ }
639
+ }
640
+
639
641
// Copy assets
640
642
if ( ! options . watch && options . assets ?. length ) {
641
643
spinner . start ( 'Copying assets...' ) ;
0 commit comments