Search code examples
javascriptgulppattern-matchingfile-globs

How do gulp pattern recursive work **/*


i started to use gulp, i have a little difficulty understand how globs work in gulp.

Why do **/* copy all directory structure(how it work)


Solution

  • Gulp uses the glob module. Rules for globbing can be found in its repo.

    • * Matches 0 or more characters in a single path portion
    • ** If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches. It does not crawl symlinked directories.

    ** means "recursively descend through subdirectories" while * means "match any path".