Skip to content

Bladhard/gulp-webp-html-fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gulp-webp-html-fix

Fix bugs Replace <img/> to <picture/> supports webp

npm (scoped) License

Install

npm i --save-dev gulp-webp-html-fix

Example

// Input
<img src="/img/tmp/catalogImage.jpg">

// Output
<picture>
    <source srcset="/img/tmp/catalogImage.webp" type="image/webp">
    <img src="/img/tmp/catalogImage.jpg">
</picture>

Usage

var webpHTML = require('gulp-webp-html');

gulp.task('html',function(){
    gulp.src('./assets/**/*.html')
        .pipe(webpHTML())
        .pipe(gulp.dest('./public/'))
});

Original

gulp-webp-html

Donate

Buy Me A Coffee

About

Fix bugs Replace <img/> to <picture/> supports webp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published