bridgetownrb / bridgetown

A next-generation progressive site generator & fullstack framework, powered by Ruby
https://www.bridgetownrb.com
MIT License
1.14k stars 114 forks source link

esbuild: Add webp to the file endings loaded as files #863

Closed moonglum closed 6 months ago

moonglum commented 7 months ago

This is a 🙋 feature or enhancement.

Summary

This PR adds a few file extensions as a file type to the list in esbuild.defaults.js:

With this change, WebP, AVIF and JPEG-XL images are supported in the same way that PNG and JPEG are supported. It also adds .jpeg as the alternative file extension for JPEG files.

Context

This is from a discussion about me failing to fingerprint images

matiaskorhonen commented 6 months ago

Sort of related: .jpeg should be added as well

I ran in to that recently but never got around to opening a PR…

moonglum commented 6 months ago

Thanks, @matiaskorhonen :+1: Added it, alongside AVIF and JPEG-XL. That would then complete the list of the image formats I have on my radar.

jaredcwhite commented 6 months ago

Fantastic!

matiaskorhonen commented 6 months ago

Should this change have actually gone into bridgetown-core/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb instead?

moonglum commented 6 months ago

I think you're right, @matiaskorhonen . PR is here: https://github.com/bridgetownrb/bridgetown/pull/870