Dragory / gulp-hash

A gulp plugin for cachebusting files by adding a hash to their name and/or content.
MIT License
69 stars 24 forks source link

All hashes in different hash files #29

Open danielsatanik opened 6 years ago

danielsatanik commented 6 years ago

I have multiple tasks in my hash file and after the whole pipeline is run through all of my different hash files for the different tasks have the data accumulated. As a result I have the css in its own hash file, the js hash file also has the css inside, the videos hash file includes the css, js and videos and the images have all of them inside.

My code for one task looks like this

gulp.task("videos", function () {
    del(["static/videos/**/*"]);
    gulp.src("src/videos/**/*")
        .pipe(hash())
        .pipe(gulp.dest("static/videos"))
        //Create a hash map
        .pipe(hash.manifest("hash.json"))
        //Put the map in the data directory
        .pipe(gulp.dest("data/videos"));
})

Can I kind of clean the hash pipeline between tasks so the different hash files contain only certain hashes?