Glob/* 不匹配以点开头的文件 [英] Glob /* doesn't match files starting with dot

查看:19
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆