0

I have a gulp task where i copy all .html files from a dir and creates the a template.js using 'gulp-angular-templatecache'.

gulp.task('createtemplates', function () {
    return gulp.src('app/views/*.html')
        .pipe(templateCache())
        .pipe(gulp.dest('app/JS'));
})

I also have a another folder app/overwrites. This also contains .html files but these are duplicates as they also exists in app/views so i want to skip only those htmls in gulp.src which exist in app/overwrites and pick these from app/overwrites.

e.g. I have a.html, b.html and c.html in app/views and c.html also exist in app/overwrites. So i would need to pick up c.html from app/overwrites instead of app/views.

GJAIN
  • 103
  • 1
  • 6
  • not sure if you are gonna be able to handle that with a glob. You could loop over both directories and "merge" them, and provide that array as a parameter to your gulp.src. Gulp is Javascript after all, and node "fs" module should provide you with the necessary tools. – Pevara Sep 26 '17 at 13:53
  • 1
    Possible duplicate of [How to tell Gulp to skip or ignore some files in gulp.src(\[...\])?](https://stackoverflow.com/questions/26708110/how-to-tell-gulp-to-skip-or-ignore-some-files-in-gulp-src) – user93 Sep 26 '17 at 14:06
  • For some help from a similar question see https://stackoverflow.com/questions/45081698/gulp-remove-duplicates-if-exists/45096031#45096031 – Mark Sep 26 '17 at 17:28

0 Answers0