Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @sveltejs/enhanced-img #496

Open
3 tasks
benmccann opened this issue Mar 20, 2025 · 2 comments
Open
3 tasks

Add @sveltejs/enhanced-img #496

benmccann opened this issue Mar 20, 2025 · 2 comments
Labels
enhancement New feature or request pkg:create

Comments

@benmccann
Copy link
Member

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?

  • build-time optimization with @sveltejs/enhanced-img
  • fetch from CDN with @unpic/svelte
  • none

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

@manuel3108 manuel3108 added enhancement New feature or request pkg:create labels Mar 22, 2025
@manuel3108
Copy link
Member

Relates #203
Relates #218

Sounds good to me. What were you thinking about? Adding it to the default template or creating an adder? I wouldn't like doing both though, as we don't have that case anywhere currently.

@garikAsplund
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:create
Projects
None yet
Development

No branches or pull requests

3 participants