cyrilwanner / next-optimized-images

🌅 next-optimized-images automatically optimizes images used in next.js projects (jpeg, png, svg, webp and gif).
MIT License
2.21k stars 93 forks source link

External Image from API #253

Open ekoydakoykoy opened 3 years ago

ekoydakoykoy commented 3 years ago

I wanted to use this library but I cant make it work using external url (images) coming from an API.

AndrewUsher commented 3 years ago

From #74, it seems like this isn't possible ☹️ :

This is not possible, unfortunately. Since this is only a webpack loader, it can only handle local files (you can also not import remote js files with webpack). If you are in charge of the API, you can optimize the images in the API (e.g. on upload). If you are using a 3rd party API and they haven't optimized their images, you could also use an image optimization proxy in front of their images.