Closed drwpow closed 10 months ago
Additional info: it looks src-loader should be able to require an image without specifying ?sizes
, but when I tried omitting that param I ended up with ?size=undefined
as the resource name in the webpack manifest. That caused issues for me.
If that is the ideal solution—making sure omitting sizes
works—rather than this PR, I’d love to help with that instead.
The original intention of the check was to skip upscaling, but skipping Sharp processing if a user requests an image of the original size would also be ideal, both from a perf perspective, and Sharp ruining some files if it unnecessarily touches them (such as animated GIFs—see https://github.com/lovell/sharp/issues/245).
I was able to successfully build in my project, so this seems to be working. This actually solves a really big problem for me (Sharp killing animated GIFs), but I’d love to know if this causes undue side effects I’m not considering.