lorenzodejong / next-sanity-image

Utility for using responsive images hosted on the Sanity.io CDN with the Next.js image component.
MIT License
149 stars 20 forks source link

Bundle image as static asset #2

Closed darbio closed 3 years ago

darbio commented 3 years ago

Is there a way to download the static image and bundle it into the build assets? I would like to bundle my static assets in with my website when I build it and deploy to a static host (s3).

Currently I can reference images by the Sanity CDN but I'd rather these are on my own URL rather than the Sanity CDN.

lorenzodejong commented 3 years ago

Hey darbio, thanks for opening an issue. This library is specifically aimed towards using images from the Sanity CDN in a responsive manner. However i noticed there's another library which also supports downloading images from a CDN to the local filesystem: https://github.com/twopluszero/next-images. The source code from both this and next-images is fairly minimal, perhaps you can combine these to something that fits your requirements.