Search code examples
gulpnode-glob

Gulp: how do I see filenames of my glob


in Gulp, I have a glob pattern that I want to verify. For instance:

gulp.task('clean-requirejs', function() {
    return gulp.src([
        './public/res-min/**/*.js'
    ])
        .pipe(clean());
});

I want to see how the glob ['./public/res-min/**/*.js'] is expanded. How do I print the arguments/filelist which is generated by gulp.src in this example?

UPDATE: Turns out there is a really simple gulp-print which can solve the job like so:

var print = require('gulp-print').default;


[....]

.pipe(print());

Solution

  • Turns out Gulp-Debug is just right for situations like this.

    Example:

    $ npm install --save-dev gulp-debug
    
    var debug = require('gulp-debug');
    
    
    gulp.task('clean-requirejs', function() {
        return gulp.src([
            './public/res-min/**/*.js'
        ])
        .pipe(debug())
        .pipe(clean());
    });