@matthiasott@eleventy@vite Have you thought about tackling image optimization yet with Vite and 11ty? It’s still a sore sport for my use of 11ty and Vite together and was curious if you’d thought about it.
@matthiasott It’s a tough problem. I really like how 11ty’s Image plugin works, and there are roll-up plugins as well (but they were made for a SPA model, not a static model).
The issue with 11ty’s image plugin is it processes images asynchronously but there is no async/await happening, so your HTML templating processing can finish before the images have had a chance to process completely.
That’s when Vite starts to look for images, but then doesn’t find them, thus blowing up.
@zachleat@matthiasott Oh wait… I forgot a part. We are using vhtml and JSX syntax. So it’s less an 11ty/Vite issue and a JSX with 11ty issue (mostly on the JSX part).
@eleventy@vite My plan is to soon update it to Vite 5, which has just been released: https://vitejs.dev/blog/announcing-vite5
But I first need to check whether there are any breaking changes that could cause problems…
Add comment