next.js
c9e238ed - feat(next/image): support `new URL()` for `images.remotePatterns` (#77692)

Commit
312 days ago
feat(next/image): support `new URL()` for `images.remotePatterns` (#77692) Configuring `remotePatterns` can be a hassle because you have to define each of the parts. And if you forget a part, its a wildcard meaning it will match anything. This is usually not desirable since most remote images don't allow query strings. This PR adds support for using an array of `URL` objects when defining `images.remotePatterns`. ```js module.exports = { images: { remotePatterns: [ new URL('https://res.cloudinary.com/my-account/**'), new URL('https://s3.my-account.*.amazonaws.com/**'), ], }, } ``` Note that wildcards must be explicit and anything missing is assumed to no longer match.
Author
Parents
Loading