调试 gulp glob 模式(node-glob)



我有一个这样的吞咽任务:

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.phpbuild/free/plugins/但事实并非如此:

$ ls -F build/free/plugins/
$ 

我的问题:

  1. 首先,如何调试此问题?我如何获得大口大口的球体产生的结果?任何文章或材料将不胜感激。
  2. 为什么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

最新更新