twopluszero / next-images

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

Make configuration of dynamic asset prefix easier #64

Closed peter-jozsa closed 3 years ago

peter-jozsa commented 3 years ago

This PR tries to make the usage of Dynamic Asset Prefix feature more clear. From now on if dynamicAssetPrefix field in next.config.js is set to true we will always produce a dynamic url (based on the assetPrefix extracted from Next.js runtime config) for imported images during transpilation. Unlike before we do not check during transpilation if assetPrefix field is defined or not in the next.config.js.

peter-jozsa commented 3 years ago

I've also added the warning message to README about the limitations of dynamic asset prefixes and statically generated pages.

peter-jozsa commented 3 years ago

I'm closing it since the PR #65 of @megazazik already contains this change plus he took care of the limitations related to statically generated pages.