0
如何添加一個.on
偵聽器來阻止吞噬,並在下次檢測到文件重新加載時再試一次?如何處理gulp-jspm引發的錯誤?
這就是我目前試圖其中沒有
'use strict';
const gulp = require('gulp');
const jspm = require('gulp-jspm');
gulp.task('default',() => {
return gulp.watch('./src/**/*.js', ['bundle'])
.on('error', function (error) {
console.log('error');
this.emit('end');
});
});
gulp.task('bundle',() => {
return gulp.src('./src/main.js')
.pipe(jspm({ selfExecutingBundle : true })
.on('error', function (error) {
console.log('error');
this.emit('end');
})
)
.on('error', function (error) {
console.log('error');
this.emit('end');
})
.pipe(gulp.dest('./dist/'));
});
捕獲錯誤或崩潰停止一飲而盡。