简体   繁体   English

使用gulp + browserify + reactify,当遇到ReactifyError时无法发出退出

[英]use gulp+browserify+reactify, can't emit exit when got a ReactifyError

Belowing is a gulp task code, I want gulp stay running when got an error. 下面是一个gulp任务代码,我希望gulp在出现错误时保持运行。

gulp.task('tmp-script', function() {
glob('./app/pages/*.js', {}, function(err, files) {
    files.forEach(function(file) {
        browserify(file, {
            transform: [reactify]
        })
        .bundle()
        .on('error', function(err){
          console.log(err.message);
          this.emit('end');
        })
        .pipe(source(file.replace('./app/pages/', '')))
        .pipe(gulp.dest('.tmp/js'));
    });
});

}); });

But it only works for the first time. 但这仅是第一次。 When got an error again, it quit with this: 当再次出现错误时,它将退出: 在此处输入图片说明

What can I do? 我能做什么?

我的错,这是一个不好的问题,我没有在gulp(watch)任务中添加.on(error)函数...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM