fix(bazel): Make sure only single copy of @angular/bazel
is installed (#30072)
When `ng add` is invoked independently of `ng new`, a node installation of `@angular/bazel` is performed by the CLI before invoking the schematic. This step appends `@angular/bazel` to the `dependencies` section of `package.json`. The schematics then appends the same package to `devDependencies`. This leads to the warning: ``` warning package.json: "dependencies" has dependency "@angular/bazel" with range "^8.0.0-beta.13" that collides with a dependency in "devDependencies" of the same name with version "~8.0.0-beta.12" ``` PR Close #30072
This commit is contained in:

committed by
Andrew Kushnir

parent
e8d3246c6e
commit
2905bf5548
@ -40,7 +40,7 @@ export function removeKeyValueInAstObject(
|
||||
const start = prop.start.offset;
|
||||
const end = prop.end.offset;
|
||||
let length = end - start;
|
||||
const match = content.slice(end).match(/[,\s]+/);
|
||||
const match = content.slice(end).match(/^[,\s]+/);
|
||||
if (match) {
|
||||
length += match.pop() !.length;
|
||||
}
|
||||
|
Reference in New Issue
Block a user