Add @sveltejs/enhanced-img
I had been holding off because I thought one of the issues might necessitate changing the API, but it looks like that's not necessary and things should be pretty stable now.
There's a webp
and png
in the demo app: https://github.com/sveltejs/cli/blob/d1f4432c0e31677ae754d50394547eeff820ddfe/packages/create/templates/demo/src/routes/%2Bpage.svelte#L3
We should just have the png
and enhanced-img
will generate the webp and avif automatically.
It would also be nice to add to the skeleton project as I think no one should be shipping unoptimized images. For the skeleton app, it potentially could be a question like:
What image optimization should be used?
@sveltejs/enhanced-img
@unpic/svelte
Finally, I don't really like that images are currently stored in $lib/images
. This seems like it will just become a huge unorganized catch-all. Images can live in the folder where they're used alongside the +page.svelte
that includes them. This should help keep things a bit more organized. At least this was one of Rich's original arguments in favor of +page.svelte
. But we don't really demonstrate that and guide users down that path today
I'd be happy to give it a go with a little more direction in terms of the desired setup.
Somewhat related is this issue which I commented on a bit ago and am still unsure whether or not it's an enhanced-img
or vite-imagetools
problem.