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)
  • Loading branch information
JamesHenry authored May 2, 2023
1 parent 4e97ee9 commit 32cbab7
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

1 comment on commit 32cbab7

@vercel
Copy link

@vercel vercel bot commented on 32cbab7 May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app

Please sign in to comment.