Use Next.js advanced <Image/> component with the static export functionality. Optimizes all static images in an additional step after the Next.js static export.
The configuration options in the documentation do not list an option to not optimize an image.
Use Case
I am looking to only download remote images from an AWS S3 bucket into static assets for a static site at build time. However, the images on the remote server are already optimized, and I would like an option to not perform any additional optimizations / transformations on the images when they are downloaded.
Proposed Solution
Add a new configuration option (e.g. titled unoptimized) with a boolean value, with a default of false. If set to true, the specified remote image(s) would be downloaded and stored as local static images, but no optimizations would be applied in the process.
Issue
The configuration options in the documentation do not list an option to not optimize an image.
Use Case
I am looking to only download remote images from an AWS S3 bucket into static assets for a static site at build time. However, the images on the remote server are already optimized, and I would like an option to not perform any additional optimizations / transformations on the images when they are downloaded.
Proposed Solution
Add a new configuration option (e.g. titled
unoptimized
) with aboolean
value, with a default offalse
. If set totrue
, the specified remote image(s) would be downloaded and stored as local static images, but no optimizations would be applied in the process.Precedent
The similar library
next-image-export-optimizer
allows for the propunoptimized={true}
: https://github.com/Niels-IO/next-image-export-optimizer/blob/master/README.md?plain=1#L185Big thanks to everyone on this team for creating this package! It solves what seems to me to be a very obvious use case missing from Next.js.