Glob /* doesn't match files starting with dot

2019-03-17 21:48发布

I'm using gulp to copy all files from one dir to another using code like this:

gulp.src([ 'app/**/*' ]).pipe(gulp.dest('dist'));

Glob docs say * match all files, but in fact files which have names starting with dot, like .gitignore, are not copied.

How can it be worked around?

标签: gulp glob
1条回答
劫难
2楼-- · 2019-03-17 22:24

If you add the option dot: true, it should work. Eg:

gulp.task('something', function () {
    return gulp.src([ 'app/**/*' ], {
        dot: true
    }).pipe(gulp.dest('dist'));
});

Reference

查看更多
登录 后发表回答