Files
next.js/errors
StevenandGitHub c9e238edf9 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.
2025-04-02 19:13:57 -04:00
..