@@ -10,6 +10,7 @@ import { EmittedFiles, WebpackLoggingCallback, runWebpack } from '@angular-devki
1010import { join , json , normalize , tags , virtualFs } from '@angular-devkit/core' ;
1111import { NodeJsSyncHost } from '@angular-devkit/core/node' ;
1212import * as fs from 'fs' ;
13+ import * as ora from 'ora' ;
1314import * as path from 'path' ;
1415import { Observable , from } from 'rxjs' ;
1516import { concatMap , map , switchMap } from 'rxjs/operators' ;
@@ -28,6 +29,7 @@ import { BundleActionExecutor } from '../utils/action-executor';
2829import { WebpackConfigOptions } from '../utils/build-options' ;
2930import { ThresholdSeverity , checkBudgets } from '../utils/bundle-calculator' ;
3031import { findCachePath } from '../utils/cache-path' ;
32+ import { colors } from '../utils/color' ;
3133import { copyAssets } from '../utils/copy-assets' ;
3234import { cachingDisabled } from '../utils/environment-options' ;
3335import { i18nInlineEmittedFiles } from '../utils/i18n-inlining' ;
@@ -457,8 +459,7 @@ export function buildWebpackBrowser(
457459
458460 // Execute the bundle processing actions
459461 try {
460- context . logger . info ( 'Generating ES5 bundles for differential loading...' ) ;
461-
462+ const dlSpinner = ora ( 'Generating ES5 bundles for differential loading...' ) . start ( ) ;
462463 for await ( const result of executor . processAll ( processActions ) ) {
463464 processResults . push ( result ) ;
464465 }
@@ -475,10 +476,10 @@ export function buildWebpackBrowser(
475476 ) ;
476477 }
477478
478- context . logger . info ( 'ES5 bundle generation complete.' ) ;
479+ dlSpinner . succeed ( 'ES5 bundle generation complete.' ) ;
479480
480481 if ( i18n . shouldInline ) {
481- context . logger . info ( 'Generating localized bundles...' ) ;
482+ const spinner = ora ( 'Generating localized bundles...' ) . start ( ) ;
482483
483484 const inlineActions : InlineOptions [ ] = [ ] ;
484485 const processedFiles = new Set < string > ( ) ;
@@ -528,12 +529,14 @@ export function buildWebpackBrowser(
528529 ) ;
529530 }
530531 for ( const diagnostic of result . diagnostics ) {
532+ spinner . stop ( ) ;
531533 if ( diagnostic . type === 'error' ) {
532534 hasErrors = true ;
533535 context . logger . error ( diagnostic . message ) ;
534536 } else {
535537 context . logger . warn ( diagnostic . message ) ;
536538 }
539+ spinner . start ( ) ;
537540 }
538541 }
539542
@@ -555,14 +558,16 @@ export function buildWebpackBrowser(
555558 '' ,
556559 ) ;
557560 } catch ( err ) {
558- context . logger . error ( 'Localized bundle generation failed: ' + err . message ) ;
561+ spinner . fail ( colors . redBright ( 'Localized bundle generation failed: ' + err . message ) ) ;
559562
560563 return { success : false } ;
561564 }
562565
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+ }
566571
567572 if ( hasErrors ) {
568573 return { success : false } ;
0 commit comments