0

我有以下 gulpfile.js,我正在通过命令行“gulp”执行它:

 var conf = require('./config.json');
var gulp = require('gulp');
var pug = require('gulp-pug');
//var watch = require('gulp-watch');

function pug(){
    return gulp.src(conf.src.pug + '/*.pug')
        .pipe(pug({
            pretty: true
        }))
        .pipe(gulp.dest(conf.dest.html));
};
function watch(){
    gulp.watch("*.pug", pug);
}
exports.watch = watch;

gulp.task('default',pug);

我收到以下错误消息:

PS C:\intt> gulp
[15:19:35] Using gulpfile C:\intt\gulpfile.js
[15:19:35] Starting 'default'...
[15:19:35] The following tasks did not complete: default
[15:19:35] Did you forget to signal async completion?
PS C:\intt>
4

1 回答 1

0

您必须更改如下代码

exports.pug = pug;

gulp.task('default',pug);

希望这会有所帮助..!

于 2019-11-26T18:32:35.040 回答