gulp-webp-in-html
v1.0.1
Published
Replaces the <img> tag with <picture> <source> <img> in HTML files
Downloads
76
Readme
gulp-webp-in-html
This is a modified version of the plugin gulp-webp-html. Here was fixed thebug that added two dots before webp to the final html file.
Example
// Input
<img src="/images/catalogImage.jpg">
// Output
<picture>
<source srcset="/images/catalogImage.webp" type="image/webp">
<img src="/images/catalogImage.jpg">
</picture>
Install
npm i --save-dev gulp-webp-in-html
Usage
var GulpWebpHtml2 = require('gulp-webp-in-html');
gulp.task('html',function(){
gulp.src('./assets/**/*.html')
.pipe(GulpWebpHtml2())
.pipe(gulp.dest('./public/'))
});