mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 20:52:06 +08:00
fix(@angular-devkit/build-angular): handle ng-packagr errors more gracefully.
Ng-packagr will throw an error when a compilation fails.
This commit is contained in:
parent
e5ba29c7d5
commit
ab17b1721c
@ -8,8 +8,8 @@
|
||||
|
||||
import { BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect';
|
||||
import { resolve } from 'path';
|
||||
import { Observable, from } from 'rxjs';
|
||||
import { mapTo, switchMap } from 'rxjs/operators';
|
||||
import { Observable, from, of } from 'rxjs';
|
||||
import { catchError, mapTo, switchMap } from 'rxjs/operators';
|
||||
import { Schema as NgPackagrBuilderOptions } from './schema';
|
||||
|
||||
async function initialize(
|
||||
@ -37,6 +37,7 @@ export function execute(
|
||||
return from(initialize(options, context.workspaceRoot)).pipe(
|
||||
switchMap((packager) => (options.watch ? packager.watch() : packager.build())),
|
||||
mapTo({ success: true }),
|
||||
catchError((err) => of({ success: false, error: err.message })),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user