Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 664 Bytes

README.md

File metadata and controls

26 lines (22 loc) · 664 Bytes

gulp-css-image-hash appends a hash of the contents of images referenced in your CSS. This means when an image is changed it will have a different URL and won't be fetched from cache.

Usage

var imagehash = require('gulp-css-image-hash');
gulp.task('css', function() {
    return gulp.src('./css/*.css')
        .pipe(imagehash())
        .pipe(gulp.dest('./dist'));
});

imagehash takes an optional parameter to point to the root of your web folder.

var imagehash = require('gulp-css-image-hash');
gulp.task('css', function() {
    return gulp.src('./css/*.css')
        .pipe(imagehash('./web'))
        .pipe(gulp.dest('./dist'));
});