a plugin for gulp.js to replace version for images in css files,the version should be file's md5 or time stamp;
npm install gulp-make-css-url-version
var makeUrlVer = require('gulp-make-css-url-version');
gulp.task('stylesheets', function() {
gulp.src('css/*.css')
.pipe(makeUrlVer())
.pipe(gulp.dest('dist'))
});
useDate :make version with time stamp
var makeUrlVer = require('gulp-make-css-url-version');
gulp.task('stylesheets', function() {
gulp.src('css/*.css')
.pipe(makeUrlVer({useDate:true}))
.pipe(gulp.dest('dist'))
});
assetsDir: specify the public directory for correct MD5 calculation in some specific cases
var makeUrlVer = require('gulp-make-css-url-version');
gulp.task('stylesheets', function() {
gulp.src('css/*.css')
.pipe(makeUrlVer({
assetsDir: __dirname + '/public'
}))
.pipe(gulp.dest('dist'))
});
/* loading */
.i-loading{width:32px;height:32px;background:url(../images/loading.gif) no-repeat;}
/* loading */
.i-loading{width:32px;height:32px;background:url(../images/loading.gif?v=Je0sUcMH0mhJPWdZdpHzXg%3D%3D) no-repeat}