Gulppipe道最小function?

什么是最小的function,可以放在一个Gulppipe道,仍然工作?

这不起作用:

gulp.src('**') .pipe(function() { // what's the minimum that can go here and still be a functional pipe? // what needs to be returned? }); 

理想情况下,这将是香草JS只使用Gulpbuild立的基本模块; 乙烯基,通过等

你的pipe道的问题是你放弃你的glob的文件,因为你没有返回它们。

使用through2 ,你可以做这样的事情:

 const through = require('through2') gulp.src('**') .pipe(through.obj((file, enc, cb) => cb(null, file)))