Skip to content

gulp.src walks entire directory trees of ignored folders #142

@PixievoltNo1

Description

@PixievoltNo1

What were you expecting to happen?

If I tell gulp.src to ignore a folder using an option such as ignore: "node_modules/**", it skips over it entirely.

What actually happened?

gulp.src walks the entire contents of the ignored folder, checking that every single file within is indeed matched by an ignore glob. Essentially the #129 problem, but this time caused by Gulp not skipping an ignored folder. Replacing the "/**" suffix with "/" or removing it altogether doesn't help. If anything within is a broken NTFS junction, such as one leftover when pnpm removed a package, Gulp crashes with Error: ENOENT: no such file or directory, stat [path of broken junction here].

Please give us a sample of your gulpfile

var gulp = require(‘gulp');

gulp.task(function test() {
    return gulp.src(["**/*"], {ignore: "node_modules/**", sourcemaps: true});
});

Please provide the following information:

  • OS & version [e.g. MacOS Catalina 10.15.4]: Windows 10
  • node version (run node -v): v22.13.1
  • npm version (run npm -v): 8.19.2
  • gulp version (run gulp -v): 5.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions