gulp-webp-in-html-vnetti
v1.1.0
Published
Replaces the <img> tag with <picture> <source> <img> in HTML files
Downloads
2
Readme
gulp-webp-in-html
This is a modified version of the plugin gulp-webp-in-html. Here was added an exception when pictures are in format .svf/.gif.
Example
// Input
<img src="/images/catalogImage.jpg">
<img src="/images/catalogImage.svg">
<img src="/images/catalogImage.gif">
// Output
<picture>
<source srcset="/images/catalogImage.webp" type="image/webp">
<img src="/images/catalogImage.jpg">
</picture>
<img src="/images/catalogImage.svg">
<img src="/images/catalogImage.gif">
Install
npm i --save-dev gulp-webp-in-html-vnetti
Usage
var GulpWebpHtmlVnetti = require('gulp-webp-in-html-vnetti');
gulp.task('html',function(){
gulp.src('./assets/**/*.html')
.pipe(GulpWebpHtmlVnetti())
.pipe(gulp.dest('./public/'))
});