Skip to content

Commit

Permalink
fix(core): ignore angular.json projects if @nrwl/angular is not insta…
Browse files Browse the repository at this point in the history
…lled
  • Loading branch information
FrozenPandaz committed Dec 14, 2022
1 parent 486516e commit 97b622c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/nx/src/config/workspaces.ts
Expand Up @@ -33,7 +33,8 @@ import { joinPathFragments } from '../utils/path';
export function workspaceConfigName(
root: string
): 'angular.json' | 'workspace.json' | null {
if (existsSync(path.join(root, 'angular.json'))) {
// If a workspace doesn't have `@nrwl/angular` it's likely they do not want projects from `angular.json` to be considered by Nx.
if (existsSync(path.join(root, 'angular.json')) && isNrwlAngularInstalled()) {
return 'angular.json';
} else if (existsSync(path.join(root, 'workspace.json'))) {
return 'workspace.json';
Expand Down Expand Up @@ -431,6 +432,15 @@ function assertValidWorkspaceConfiguration(
}
}

function isNrwlAngularInstalled() {
try {
require.resolve('@nrwl/angular');
return true;
} catch {
return false;
}
}

function findFullGeneratorName(
name: string,
generators: {
Expand Down

0 comments on commit 97b622c

Please sign in to comment.