I
I
IronPants2021-02-18 18:19:21
gulp.js
IronPants, 2021-02-18 18:19:21

Gulp-webp-in-html how to disable for svg images?

Is there a way (idea) how to add img tags that have src to svg images to exceptions for the gulp-webp-in-html plugin?

Here's what's happening now:

src:

<img class="social__img" src="assets/img/pinterest.svg" alt=Pinterest">

dist:
<picture>
    <source srcset="assets/img/pinterest.svg" type="image/webp">
    <img class="social__img" src="assets/img/pinterest.svg" alt="Pinterest">
</picture>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lamer350, 2021-02-18
@lamer350

Idea:
fix the condition in the module, judging by the github there is no check by file type, I think where the url in the module is checked at all and check the file type

I
ivanSenior, 2021-12-24
@ivanSenior

npm i webpHtmlNosvg --save-dev Plugin that excludes svg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question