Answer the question
In order to leave comments, you need to log in
How to add srcset attribute to Gulp (retina)?
Using the gulp-webp plugin, I convert images to webp and using image-image-resize I create a retina and the following structure is obtained:
img/
img.jpeg
img.webp
[email protected]
[email protected]
<img src="img.jpeg">
<picture>
<source srcset="img.webp" type="image/webp">
<img src="img.jpeg" alt srcset="img.jpeg 1x, [email protected] 2x">
</picture>
<picture>
<source srcset="img.webp 1x, [email protected] 2x" type="image/webp">
<img src="img.jpeg" alt srcset="img.jpeg 1x, [email protected] 2x">
</picture>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question