簡體   English   中英

使用gulp + browserify + reactify,當遇到ReactifyError時無法發出退出

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

下面是一個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'));
    });
});

});

但這僅是第一次。 當再次出現錯誤時,它將退出: 在此處輸入圖片說明

我能做什么?

我的錯,這是一個不好的問題,我沒有在gulp(watch)任務中添加.on(error)函數...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM