diff --git a/packages/devkit/src/generators/visit-not-ignored-files.ts b/packages/devkit/src/generators/visit-not-ignored-files.ts index 34822d16dca44..97d98df8a1c2f 100644 --- a/packages/devkit/src/generators/visit-not-ignored-files.ts +++ b/packages/devkit/src/generators/visit-not-ignored-files.ts @@ -10,12 +10,16 @@ export function visitNotIgnoredFiles( dirPath: string = tree.root, visitor: (path: string) => void ): void { + // TODO (v17): use packages/nx/src/utils/ignore.ts let ig: Ignore; if (tree.exists('.gitignore')) { ig = ignore(); ig.add('.git'); ig.add(tree.read('.gitignore', 'utf-8')); } + if (tree.exists('.nxignore')) { + ig.add(tree.read('.nxignore', 'utf-8')); + } dirPath = normalizePathRelativeToRoot(dirPath, tree.root); if (dirPath !== '' && ig?.ignores(dirPath)) { return;