【发布时间】:2017-01-16 08:26:41
【问题描述】:
我收到上述错误:
错误:对lazypipe().pipe() 的无效调用:参数不是函数。
切记不要直接调用流创建函数!例如。: 管道(foo),而不是管道(foo())。
这对我来说完全有道理(尤其是因为已经有一些相关的问题),但是我怎样才能将参数传递给惰性管道呢?
function buildPipes(fileName) {
return lazypipe()
.pipe($.concat(fileName))
.pipe(gulp.dest(destFull))
.pipe($.rename(minFileName))
.pipe($.babel({
presets: ["es2015"]
}))
.pipe($.uglify({
compress: {
hoist_funs: false
}
}))
.pipe(gulp.dest(dest));
}
我脚本的另一部分,使用管道:
var vendor = gulp.src(sources.vendor).pipe(buildPipes(fileName));
【问题讨论】:
标签: javascript build gulp