var stream = gulp.watch("../web/*", function(event){
...
//打印stream
console.log(stream);
})
想通过gulp.watch监测web文件变化,待变化完成后将web/*中的文件转移到另外一个地方,不知道gulp是否有提供变化完成的事件?
打印stream看到了这些东西,但貌似都不能满足要求,求高手指点,谢谢!
EventEmitter {
domain: null,
_events: { end: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
end: [Function],
add: [Function],
remove: [Function],
_watcher:
Gaze {
domain: null,
_events:
{ end: [Function: bound cb],
error: [Function: bound cb],
ready: [Function: bound cb],
nomatch: [Function: bound cb],
all: [Function] },
}
...
}
先定义个 gulp.task('move', function(){ gulp.src().pipe(gulp.dist())}) 作用就是移动文件。。
gulp.watch(glob[, opts], tasks) //官方API http://www.gulpjs.com.cn/docs/api/
gulp.watch('web/*', ['move'])