Glob/*与以点开头的文件不匹配 [英] Glob /* doesn't match files starting with dot
本文介绍了Glob/*与以点开头的文件不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用gulp使用以下代码将所有文件从一个目录复制到另一个目录:
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文档说*
匹配所有文件,但实际上不会复制名称以点开头的文件(例如.gitignore
).
Glob docs say *
match all files, but in fact files which have names starting with dot, like .gitignore
, are not copied.
如何解决?
推荐答案
如果添加选项dot: true
,它应该可以工作.例如:
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'));
});
这篇关于Glob/*与以点开头的文件不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文