How do gulp pattern recursive work **/*

66 views Asked by At

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)

2

There are 2 answers

0
Joseph On BEST ANSWER

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".

0
BonTheBeerman On

Extending your folder structure css/**/*.css

** means recursive.

This means your telling gulp to go inside css folder and all it's subdirectories and compile all files that has an extension .css