twopluszero / next-images

Import images in Next.js (supports jpg, jpeg, svg, png and gif images)
MIT License
948 stars 67 forks source link

Adds note on using with next/image component #57

Closed mikaelbr closed 3 years ago

mikaelbr commented 3 years ago

Hi! Thanks for the package. Use it a lot and love it for creating semantically grouped resources in feature folders!

Today Vercel announced Next.js 10.0.0. In 10.0.0 you have the next/image component which optimizes images either through servers, external loaders, or Vercel. In any case, it seems to work with next-images and resolving images not placed in public/ folder. However, obviously, it doesn't play well with Data URLs and thus there can be some issues with the default value of inline images with this package. Also, I think much of the cases where Data URLs are handy can be optimized better with coachable generated webp files. So this PR adds a note on using with next/image component and recommends deactivating inline images entirely when doing so.

arefaslani commented 3 years ago

@mikaelbr Thanks for updating the readme file! I think I should check next/image to see how we can play nice with it in the future 👍

mikaelbr commented 3 years ago

FYI, I also posted this PR that should help with potential issues regarding this: https://github.com/vercel/next.js/pull/18326

arefaslani commented 3 years ago

@mikaelbr Cool, thanks 🙏