@@ -10,6 +10,7 @@ import { EmittedFiles, WebpackLoggingCallback, runWebpack } from '@angular-devki
10
10
import { join , json , normalize , tags , virtualFs } from '@angular-devkit/core' ;
11
11
import { NodeJsSyncHost } from '@angular-devkit/core/node' ;
12
12
import * as fs from 'fs' ;
13
+ import * as ora from 'ora' ;
13
14
import * as path from 'path' ;
14
15
import { Observable , from } from 'rxjs' ;
15
16
import { concatMap , map , switchMap } from 'rxjs/operators' ;
@@ -28,6 +29,7 @@ import { BundleActionExecutor } from '../utils/action-executor';
28
29
import { WebpackConfigOptions } from '../utils/build-options' ;
29
30
import { ThresholdSeverity , checkBudgets } from '../utils/bundle-calculator' ;
30
31
import { findCachePath } from '../utils/cache-path' ;
32
+ import { colors } from '../utils/color' ;
31
33
import { copyAssets } from '../utils/copy-assets' ;
32
34
import { cachingDisabled } from '../utils/environment-options' ;
33
35
import { i18nInlineEmittedFiles } from '../utils/i18n-inlining' ;
@@ -457,8 +459,7 @@ export function buildWebpackBrowser(
457
459
458
460
// Execute the bundle processing actions
459
461
try {
460
- context . logger . info ( 'Generating ES5 bundles for differential loading...' ) ;
461
-
462
+ const dlSpinner = ora ( 'Generating ES5 bundles for differential loading...' ) . start ( ) ;
462
463
for await ( const result of executor . processAll ( processActions ) ) {
463
464
processResults . push ( result ) ;
464
465
}
@@ -475,10 +476,10 @@ export function buildWebpackBrowser(
475
476
) ;
476
477
}
477
478
478
- context . logger . info ( 'ES5 bundle generation complete.' ) ;
479
+ dlSpinner . succeed ( 'ES5 bundle generation complete.' ) ;
479
480
480
481
if ( i18n . shouldInline ) {
481
- context . logger . info ( 'Generating localized bundles...' ) ;
482
+ const spinner = ora ( 'Generating localized bundles...' ) . start ( ) ;
482
483
483
484
const inlineActions : InlineOptions [ ] = [ ] ;
484
485
const processedFiles = new Set < string > ( ) ;
@@ -528,12 +529,14 @@ export function buildWebpackBrowser(
528
529
) ;
529
530
}
530
531
for ( const diagnostic of result . diagnostics ) {
532
+ spinner . stop ( ) ;
531
533
if ( diagnostic . type === 'error' ) {
532
534
hasErrors = true ;
533
535
context . logger . error ( diagnostic . message ) ;
534
536
} else {
535
537
context . logger . warn ( diagnostic . message ) ;
536
538
}
539
+ spinner . start ( ) ;
537
540
}
538
541
}
539
542
@@ -555,14 +558,16 @@ export function buildWebpackBrowser(
555
558
'' ,
556
559
) ;
557
560
} catch ( err ) {
558
- context . logger . error ( 'Localized bundle generation failed: ' + err . message ) ;
561
+ spinner . fail ( colors . redBright ( 'Localized bundle generation failed: ' + err . message ) ) ;
559
562
560
563
return { success : false } ;
561
564
}
562
565
563
- context . logger . info (
564
- `Localized bundle generation ${ hasErrors ? 'failed' : 'complete' } .` ,
565
- ) ;
566
+ if ( hasErrors ) {
567
+ spinner . fail ( colors . redBright ( 'Localized bundle generation failed.' ) ) ;
568
+ } else {
569
+ spinner . succeed ( 'Localized bundle generation complete.' ) ;
570
+ }
566
571
567
572
if ( hasErrors ) {
568
573
return { success : false } ;
0 commit comments