Skip to content

D3R/gulp-css-image-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'));
});

About

Append a hash of the images value to references in CSS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published