-
Hello, I stumbled across the Thanks for all your work in the vite ecosystem |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi Quentin! This plugin will "generate JS" for imports of images. In contrast, As a result, there's no direct way to integrate both plugins.
You could create a A disadvantage of optimizing in-place is that the fingerprint would not change, so changing your optimization params wouldn't affect the result, but if you are doing standard optimizations maybe that's acceptable (and would be a very easy way to achieve optimally sized images). |
Beta Was this translation helpful? Give feedback.
Hi Quentin!
This plugin will "generate JS" for imports of images.
In contrast,
vite-plugin-ruby
will copy files directly and generate amanifest-assets.json
file to compensate for Vite's lack of support for adding non-(JS or CSS) assets as entrypoints.As a result, there's no direct way to integrate both plugins.
You could create a
post
Vite plugin with awriteBundle
callback, walk throughconfig.build.assetsDir
and manually usesharp
to optimize assets in place.A disadvantage of optimizing in-place is that the fingerprint would not change, so changing your optimization params wouldn't affect the result, but if you are doing standard optim…