Gulp:如何将输出保存在变量中而不是保存在文件中?

时间:2018-07-25 15:56:07

标签: javascript gulp

我正在使用口吃的任务为我做某事。但是,我不想将输出保存在文件中(例如gulp.dest('folder / destination /')。我想将输出作为字符串保存在变量中。所以我想要这样的东西:

// this is how I know to do it
gulp.task('example', function() {
  gulp.src('folder/source/')
  .pipe(uglify()) // this does not need to be uglify() – it can be anything else
  .dest('folder/destination')
  
// this is how I want to do it
var save_it_here
gulp.task('example', function() {
  gulp.src('folder/source/')
  .pipe(uglify()) // this does not need to be uglify() – it can be anything else
  .dest(save_it_here) // this line is where I have problem

0 个答案:

没有答案