gulp.src()包含文件,但忽略所有文件夹 [英] gulp.src() include files but ignore all folders

查看:433
本文介绍了gulp.src()包含文件,但忽略所有文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这肯定有这样一个简单的答案,以至于我找不到以前被问到过的任何人:

在文件夹中包含所有文件的模式但忽略所有子文件夹?



gulp.src('*')包含所有文件和文件夹。我只想要这些文件,而不必单独排除这些文件夹。

如果您还想包括.dotFiles,那么也可以使用.dot文件。

然后尝试

  gulp.src(['folder /*.*','folder /.*'])


There is certainly such a simple answer to this that I can't find anyone that's asked it before:

What globbing pattern to include all the files in a folder but ignore ALL subfolders?

gulp.src('*') includes all files and folders. I just want the files and would rather not have to exclude the folders individually.

解决方案

If you want to include .dotFiles as well then try

gulp.src(['folder/*.*', 'folder/.*'])

这篇关于gulp.src()包含文件,但忽略所有文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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