mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 11:03:53 +08:00
A custom builder can call `context.scheduleBuilder` to call another builder. However, the following call will fail with `Must either have a target from the context or a default project.` exception because `scheduleBuilder` does not pass `target` to the called builder. ```typescript import { JsonObject } from '@angular-devkit/core' import { BuilderContext, BuilderOutput, BuilderRun, createBuilder } from '@angular-devkit/architect'; import { Observable, from } from 'rxjs'; import { concatMap, map } from 'rxjs/operators'; export default createBuilder(_customBuilder); function _customBuilder(options: JsonObject, context: BuilderContext): Observable<BuilderOutput> { const builder = '@angular-devkit/build-angular:browser'; return from(context.scheduleBuilder(builder, options)).pipe( concatMap(run => run.result) ); } ``` Resolves: https://github.com/angular/angular-cli/issues/15053
Angular Build Facade
WIP