Gulp 狼吞虎咽—;将任务/结果转换为字符串

Gulp 狼吞虎咽—;将任务/结果转换为字符串,gulp,tostring,vinyl,Gulp,Tostring,Vinyl,我想编译typescript并将结果用作另一个任务的字符串 现在我有一个gulpfile // compile typescript // shortened for clarity export const ts = _ => gulp.src('./src/ts/*.ts') .pipe(…) .pipe(…) export const pug = async _ => gulp .src('./src/pug/*.pug') .pipe(compileP

我想编译typescript并将结果用作另一个任务的字符串

现在我有一个
gulpfile



// compile typescript
// shortened for clarity
export const ts = _ => gulp.src('./src/ts/*.ts')
  .pipe(…)
  .pipe(…)


export const pug = async _ => gulp
  .src('./src/pug/*.pug')
  .pipe(compilePug({
    locals: {
      script: <result of »ts« task here as string>
    }
  }))
  .pipe(gulp.dest('./bin/html'));



//编译类型脚本
//为清晰起见缩短
导出常量ts=\u=>gulp.src('./src/ts/*.ts')
.管道(…)
.管道(…)
导出常量pug=async=>gulp
.src('./src/pug/*.pug')
.pipe(compilePug({
当地人:{
脚本:
}
}))
.管道(大口目的地('./bin/html');
如何将流中的内容读取为字符串