Here's what I have so far and what I have tried:
In my application I have files with a structure like this
/app/learn/content/ab.html
/app/learn/content/bc.html
/app/learn/content/base.html
/app/write/content/ab.html
/app/write/content/bc.html
/app/write/content/base.html
/app/xx/ab.html
/app/xx/bc.html
/app/xx/base.html
I set up a watcher like this:
var abc = {
src: [
'**/ab.html',
'**/bc.html',
],
}
gulp.task('watchHTMLs', function () {
gulp.watch(abc.src, function (file) {
return gulp.src(path.basename(file.path))
.pipe(rename('base.html'))
.pipe(gulp.dest('./'));
})
});
What I would like to do is to watch for files with ab.html or bc.html file names and then copy these to base.html in the same directory when one changes. But so far my watcher starts but then nothing at all happens when I change one of the ab.html or bc.html files. The watcher does not even seem to fire.
Can anyone point me to what I am doing wrong?