From 3fb98fe4ead6ba0965f5a09841a3c1a29ab3006b Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Wed, 21 Jun 2017 14:16:56 +0100 Subject: [PATCH] build(aio): do not recurse node_modules when loading examples in doc-gen --- aio/tools/transforms/angular-content-package/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aio/tools/transforms/angular-content-package/index.js b/aio/tools/transforms/angular-content-package/index.js index f3e8384a0c..5584a41828 100644 --- a/aio/tools/transforms/angular-content-package/index.js +++ b/aio/tools/transforms/angular-content-package/index.js @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ const Package = require('dgeni').Package; -const globby = require('globby'); +const glob = require('glob'); const ignore = require('ignore'); const fs = require('fs'); const path = require('canonical-path'); @@ -23,7 +23,7 @@ module.exports = new Package('angular-content', [basePackage, contentPackage]) const gitignoreFile = fs.readFileSync(path.resolve(GUIDE_EXAMPLES_PATH, '.gitignore'), 'utf8'); const gitignore = ignore().add(gitignoreFile); - const examplePaths = globby.sync('**/*', { cwd: GUIDE_EXAMPLES_PATH, mark: true, dot: true }) + const examplePaths = glob.sync('**/*', { cwd: GUIDE_EXAMPLES_PATH, dot: true, ignore: '**/node_modules/**', mark: true }) .filter(filePath => filePath !== '.gitignore') // we are not interested in the .gitignore file itself .filter(filePath => !/\/$/.test(filePath)); // this filter removes the folders, leaving only files const filteredExamplePaths = gitignore.filter(examplePaths) // filter out files that match the .gitignore rules