fix(bazel): support running ng-add on minimal applications (#29681)
Minimal applications don't have `test` and `e2e` targets but we are not currently checking if they exists. Fixes #29680 PR Close #29681
This commit is contained in:
@ -154,15 +154,18 @@ function updateAngularJsonToUseBazelBuilder(options: Schema): Rule {
|
||||
},
|
||||
},
|
||||
indent);
|
||||
replacePropertyInAstObject(
|
||||
recorder, architect, 'test', {
|
||||
builder: '@angular/bazel:build',
|
||||
options: {'bazelCommand': 'test', 'targetLabel': '//src/...'},
|
||||
},
|
||||
indent);
|
||||
|
||||
if (findPropertyInAstObject(architect, 'test')) {
|
||||
replacePropertyInAstObject(
|
||||
recorder, architect, 'test', {
|
||||
builder: '@angular/bazel:build',
|
||||
options: {'bazelCommand': 'test', 'targetLabel': '//src/...'},
|
||||
},
|
||||
indent);
|
||||
}
|
||||
|
||||
const e2eArchitect = findE2eArchitect(workspaceJsonAst, name);
|
||||
if (e2eArchitect) {
|
||||
if (e2eArchitect && findPropertyInAstObject(e2eArchitect, 'e2e')) {
|
||||
replacePropertyInAstObject(
|
||||
recorder, e2eArchitect, 'e2e', {
|
||||
builder: '@angular/bazel:build',
|
||||
|
Reference in New Issue
Block a user