2

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

1 Answer 1

7

You are watching the dest folder. Try changing tsClientHtml to './client2/angularts/**/*.html'.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.