debugging gulp glob patterns (node-glob)

496 Views Asked by At

I have a gulp task like this:

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));
});

My dir structure:

$ ls -F src/plugins/
RecipeIndex/    VisitorRating/  index.php

I'm expecting index.php to be in build/free/plugins/ but it's not:

$ ls -F build/free/plugins/
$ 

My questions:

  1. How can I debug this issue, first of all? How would I get the result that the gulp glob is producing? Any article or material would be appreciated.
  2. Why isn't index.php showing up in build/free/plugins/?

P.S.: Changing gulp glob order to this doesn't make a difference: ["src/**", "!src/composer.*", "LICENSE", "!src/plugins/**", "src/plugins/index.php"]

1

There are 1 best solutions below

0
On

To expand on @Cassidy Laidlaw's commment you can try the following, or the other options from this previous post to debug:

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'));
});

This will output lines to the console like:

[22:23:05] gulp-debug: LICENSE
[22:23:05] gulp-debug: 1 item