从gulp版本3转换为gulp版本4时面临的问题
在gulp版本3中,我的从gulp版本3转换为gulp版本4时面临的问题,gulp,Gulp,在gulp版本3中,我的helpgulp任务定义为: gulp.task('help', function() { var command = chalk.bold.green; console.log(command('gulp build-task') + ': runs certain build tasks'); }); gulp.task('default', ['help']); 我执行以下操作以将其转换为第4版的吞咽: gulp.task('help', function(
help
gulp任务定义为:
gulp.task('help', function() {
var command = chalk.bold.green;
console.log(command('gulp build-task') + ': runs certain build tasks');
});
gulp.task('default', ['help']);
我执行以下操作以将其转换为第4版的吞咽:
gulp.task('help', function() {
var command = chalk.bold.green;
console.log(command('gulp build-task') + ': runs certain build tasks');
});
gulp.task('default', gulp.series('help'));
[01:58:01] The following tasks did not complete: default, help
[01:58:01] Did you forget to signal async completion?
运行gulp
时,我看到以下错误:
gulp.task('help', function() {
var command = chalk.bold.green;
console.log(command('gulp build-task') + ': runs certain build tasks');
});
gulp.task('default', gulp.series('help'));
[01:58:01] The following tasks did not complete: default, help
[01:58:01] Did you forget to signal async completion?
另外,我希望先运行帮助
任务,然后运行默认值
。在我的版本4示例中,default
首先运行
有人能帮我吗?谢谢大家! 有很多方法可以解决这个问题。最简单的一个-您的函数应该返回(使用):
稍加清理后:
async function help() {
const command = chalk.bold.green;
console.log(command('gulp build-task') + ': runs certain build tasks');
};
gulp.task('default', gulp.series(help));