How to use the imagetools plugin with vite-rails ? #248
-
hi ! Thank you for vite-ruby and vite-rails I am loving this modern frontend experience with Rails :) I'd like to autocompile my images to a modern format like WebP or AVIF. The vite-imagetools plugin seems to do just that. However I'm having a hard time using it with vite-rails. I've tried a naive: vite_image_tag("images/some-image.png?webp&w=50") in my template but it's not doing the trick. the vite plugin suggests to import files with these query parameters, but that's only valid for files used from within JS/TS code it seems. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
That's correct, it inspects JS code to detect the transforms and generate the corresponding images for them. That plugin does not currently solve the use case you have in mind. |
Beta Was this translation helpful? Give feedback.
That's correct, it inspects JS code to detect the transforms and generate the corresponding images for them.
That plugin does not currently solve the use case you have in mind.