gulp-gift-md5
GiftTalk gulp static file md5 file
Usage
First, install gulp-gift-md5
as a development dependency:
npm install --save-dev gulp-gift-md5
Then, add it to your gulpfile.js
:
var md5 = require("gulp-gift-md5");
gulp.src("./src/*.css")
.pipe(md5(10,'./output/index.html'))
.pipe(gulp.dest("./dist"));
md5 all css files in the src folder and change these css names in the quoted html--index.html
gulp.task('img', function() {
var imgSrc = './static/img/**',
quoteSrc = './output/static/css/**/*.css', // [./output/static/css/**/*.css',./output/static/js/**/*.js']
imgDst = './output/static/img';
return gulp.src(imgSrc)
.pipe(imagemin())
.pipe(md5(10, quoteSrc))
.pipe(gulp.dest(imgDst));
});