我試着用gulp.watch和觀看(一飲而盡手錶),但是當我添加新的文件,不要在dest複製。我gulpfile可以編輯(變化)和刪除文件,但不復制新(加)文件
我該怎麼做呢?
Thnks!
PD:我使用的版本3.9.1
gulp.task('default', function() {
for(var i = 0; i < origen_web.length ; i++) {
var source = '../..' + '/dir' + '/**/*';
var dist = '../../dist';
watch(source, function(obj){
copyFiles(obj, source, dist);
});
}
}
function copyFiles(source, dist, obj) {
gulp.src(source)
.pipe(gulp.dest(dist));
}
對不起,這是我的代碼更加少了。
你可以發佈你的gulp文件的例子嗎? – mutantkeyboard
我張貼一些代碼:) –
https://stackoverflow.com/questions/22391527/gulps-gulp-watch-not-triggered-for-new-or-deleted-files – Mark