Reputation: 2256
I have a gulp task to copy all html files from source to destination.
html gulp task
var gulp = require('gulp');
module.exports = function() {
return gulp.src('./client2/angularts/**/*.html')
.pipe(gulp.dest('./client2/script/src/'));
};
and gulp watch which start running whenever I change .Html file it swill start html gulp task.
watch.ts
var gulp = require('gulp');
var watch = require('gulp-watch');
var sq = require('run-sequence');
module.exports = function () {
var tsClientHtml = [
'client2/**/*.html'
];
watch(tsClientHtml, function () {
gulp.run('html');
});
};
Its going in infinite loop, means whenever I am changing in html file its ruining html gulp task again and again... Can someone please suggest what is wrong in this watch.ts
Upvotes: 2
Views: 871
Reputation: 14979
You are watching the dest folder. Try changing tsClientHtml to './client2/angularts/**/*.html'
.
Upvotes: 7