Skip to content

Commit

Permalink
fix(core): only modify angular.json on read when @nx/angular is prese…
Browse files Browse the repository at this point in the history
…nt (#16693)

(cherry picked from commit 32cbab7)
  • Loading branch information
JamesHenry authored and FrozenPandaz committed May 2, 2023
1 parent 333ce39 commit 9d8d5cd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/nx/src/adapter/ngcli-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ export class NxScopedHost extends virtualFs.ScopedHost<any> {
}

read(path: Path): Observable<FileBuffer> {
if (path === 'angular.json' || path === '/angular.json') {
if (
(path === 'angular.json' || path === '/angular.json') &&
isAngularPluginInstalled()
) {
return this.readMergedWorkspaceConfiguration().pipe(
map((r) => Buffer.from(JSON.stringify(toOldFormat(r))))
);
Expand Down Expand Up @@ -566,7 +569,10 @@ export class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
}

read(path: Path): Observable<FileBuffer> {
if (path == 'angular.json' || path == '/angular.json') {
if (
(path === 'angular.json' || path === '/angular.json') &&
isAngularPluginInstalled()
) {
const projectJsonConfig = toOldFormat({
projects: Object.fromEntries(getProjects(this.host)),
});
Expand Down

0 comments on commit 9d8d5cd

Please sign in to comment.