Is there a way to set prefix for all local images in next js using next.config.js?

Viewed 1165

I have setup my next js code with some static images into the system which is used as

<Image
  height={50}
  width={140}
  alt="Alt"
  objectFit="contain"
  src="/images/logo.png"
/>

but now I have to deploy it with basePath: '/product. Urls are working fine but images are not loading and I need to use /product/images/logo.png before every src.

Is there a way to set in next.config.js and I don't have to change it for the every single image in the system?

0 Answers
Related