【发布时间】:2016-07-22 03:55:11
【问题描述】:
我的gulpfile.js 中有一个共同的模式:
var rev = require('gulp-rev');
var buffer = require('gulp-buffer');
gulp.src.some_stuff
.pipe(anotherStuff)
.pipe(buffer()) // this line & 4 lines down
.pipe(rev())
.pipe(gulp.dest(options.dest))
.pipe(rev.manifest({ path: 'manifest.json', merge: true }))
.pipe(gulp.dest(options.dest)) // to this
.pipe(extrastuff)
我想编写这 5 行代码,以便在我的项目中通过几个 gulp 任务重用它们。我该怎么做?
我找到了multipipe 包,但它不支持将变量传递给新管道(你可以看到我需要在我的新管道中传递options.dest)。
【问题讨论】:
标签: javascript node.js gulp pipe