我有一个这样的吞咽任务:
const dest_free = "build/free";
gulp.task("build-free", ["clean-free"], function () {
gulp.src(["src/**", "!src/composer.*", "LICENSE", "src/plugins/index.php", "!src/plugins/**"])
.pipe(gulp.dest(dest_free));
});
我的目录结构:
$ ls -F src/plugins/
RecipeIndex/ VisitorRating/ index.php
我希望index.php
会build/free/plugins/
但事实并非如此:
$ ls -F build/free/plugins/
$
我的问题:
- 首先,如何调试此问题?我如何获得大口大口的球体产生的结果?任何文章或材料将不胜感激。
- 为什么
index.php
没有出现在build/free/plugins/
?
PS:将 gulp glob 顺序更改为此并没有什么区别:["src/**", "!src/composer.*", "LICENSE", "!src/plugins/**", "src/plugins/index.php"]
要扩展 Laidlaw 的@Cassidy,您可以尝试以下方法或上一篇文章中的其他选项进行调试:
var debug = require('gulp-debug');
gulp.task('build-free', ['clean-free'], function() {
return gulp.src(['src/**', '!src/composer.*', 'LICENSE', 'src/plugins/index.php', '!src/plugins/**'])
.pipe(debug())
.pipe(gulp.dest('build/free'));
});
这会将行输出到控制台,如下所示:
[22:23:05] gulp-debug: LICENSE
[22:23:05] gulp-debug: 1 item