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:
|
import welcome from '$lib/images/svelte-welcome.webp'; |
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?
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 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
webpandpngin the demo app:cli/packages/create/templates/demo/src/routes/+page.svelte
Line 3 in d1f4432
We should just have the
pngandenhanced-imgwill 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/svelteFinally, 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.sveltethat 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