S
S
SexyMonkey2017-01-11 19:34:39
gulp.js
SexyMonkey, 2017-01-11 19:34:39

Who can explain the strange behavior of gulp?

There are 2 tasks (besides task-watcher):

var gulp = require('gulp');

gulp.task('watch', function () {
    gulp.watch('src/*.html', ['html']);
    gulp.watch('src/*.php', ['php']);
});

gulp.task('html', function () {
    gulp.src('src/*.html')
        .pipe(gulp.dest('app'))
});

gulp.task('php', function () {
    gulp.src('src/*.php')
        .pipe(gulp.dest('app'));
});

The first (html) responds well to adding new files , the second (php) does not, it only processes the existing ones before launch.
1) What could be the matter, why does it not work in the second case?
2) Why does it work in the first case? Is the standard gulp watcher finally able to react to adding files?
gulp v3.9.1
node v6.9.4

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question