Gulp debugging - piping to process.stdout gives TypeError ('invalid data')

I am trying to debug a Gulp task that I have written. I've tried using the module 'gulp-debug'

, but all it really does is just a stat file ... which doesn't work for me.

For starters, how can I get the process to go to the terminal? I wanted to see what it outputs wiredep

. I tried .pipe(process.stdout)

but got it TypeError('invalid data')

.

var bowerStream = gulp.src('./app/bower_components')
    .pipe(wiredep())
    .pipe(process.stdout)

      

+3


source to share


2 answers


using through2 this is possible:



gulp.src('./app/index.html')
  .pipe(wiredep({directory: './app/bower_components'}))
  .pipe(through2.obj(function(obj, enc, next) {
    this.push(obj.contents);
    next();
  })).pipe(process.stdout);

      

0


source


I know this is a little late, but I wrote a blog post on how to debug gulp tasks in Visual Studio Code: https://hansrwindhoff.wordpress.com/2015/05/05/debugging-task-runner-tasks- like-gulp-with-visual-studio-code-editordebugger /



You can run the VSCode debugger to run a gulp task and then do full source level debugging on all your plugins and gulpfiles. Very comfortably!

0


source







All Articles