File tree 1 file changed +12
-2
lines changed
packages/angular_devkit/build_angular/src/browser
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -648,6 +648,7 @@ export function buildWebpackBrowser(
648
648
postTransform : transforms . indexHtml ,
649
649
} ) ;
650
650
651
+ let hasErrors = false ;
651
652
for ( const [ locale , outputPath ] of outputPaths . entries ( ) ) {
652
653
try {
653
654
const { content, warnings, errors } = await indexHtmlGenerator . process ( {
@@ -663,7 +664,10 @@ export function buildWebpackBrowser(
663
664
if ( warnings . length || errors . length ) {
664
665
spinner . stop ( ) ;
665
666
warnings . forEach ( ( m ) => context . logger . warn ( m ) ) ;
666
- errors . forEach ( ( m ) => context . logger . error ( m ) ) ;
667
+ errors . forEach ( ( m ) => {
668
+ context . logger . error ( m ) ;
669
+ hasErrors = true ;
670
+ } ) ;
667
671
spinner . start ( ) ;
668
672
}
669
673
@@ -677,7 +681,13 @@ export function buildWebpackBrowser(
677
681
}
678
682
}
679
683
680
- spinner . succeed ( 'Index html generation complete.' ) ;
684
+ if ( hasErrors ) {
685
+ spinner . fail ( 'Index html generation failed.' ) ;
686
+
687
+ return { success : false } ;
688
+ } else {
689
+ spinner . succeed ( 'Index html generation complete.' ) ;
690
+ }
681
691
}
682
692
683
693
if ( options . serviceWorker ) {
You can’t perform that action at this time.
0 commit comments