Replies: 1 comment 3 replies
-
There's an example here: https://github.com/JonasKruckenberg/imagetools/tree/main/examples This library is often used to build image components. E.g. in Svelte you can use |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone!
Maybe I'm asking something stupid, but I can't figure it out myself...so sorry in advance.
I'll explain the situation as quickly and in detail as possible.
I'm building a website with vite+react+js and I have all the images that I use in
src/public/images
. I use them in.scss
imported withulr()
or.jsx
imported directly in animg
tag as<img src={src} alt="" />
.I have
.jpg
or.png
images and I want them all converted in.webp
during build, but I don't know how to start with vite-imagetools, I get that I have to import the plugin invite.congif.js
but I don't know how to use the defaultDirectives or set anything at all :(.Do I have to import the images as
import imgUrl from './img.png'
? I'm fine with changing my code if I have to.I read the docs/discussions but maybe I'm missing the point and imagetools is not the solution to my problem.
Thank you for your kind help <3
Beta Was this translation helpful? Give feedback.
All reactions