这就是我现在所拥有的:
function make_exHtml(config) {
gulp.src(config, { base: process.cwd() })
.pipe(print(function (file) {
return "Found file " + file;
}))
.pipe(rename({ basename: 'base' }))
.pipe(gulp.dest('./'));
return gulp.src(config.srcTemplates)
.pipe(print(function (file) {
return "Added file " + file + " to template";
}))
.pipe(minifyHTML({ collapseWhitespace: true }))
.pipe(templateCache({ standalone: true, root: '/app' }))
.pipe(gulp.dest(config.destPartials))
.pipe(gzip(gzip_options))
.pipe(gulp.dest(config.destPartials));
}
我需要做的是确保第一次吞咽在第二次之前运行。有人能告诉我怎么做吗?
答案 0 :(得分:1)
您可以使用run-sequence。将make_exHtml
拆分为两个任务
var runSequence = require('run-sequence');
gulp.task('make_exHtml', function(callback) {
runSequence('first_task','second_task', function(){
make_prod('xxx');
callback();
});
});