我已在 next.config.js
上设置了图像域,但图像未显示在 localhost 上。然而,当代码被推送到生产环境时,图像会加载到 vercel 上。
在本地主机上,我得到以下图片。图片无法加载。
在生产中,可以看到图像
我应该怎么做才能看到开发中的图像?
module.exports = {
images: {
domains: [ 'd31wtm2rx76rut.cloudfront.net'],
},
}
<NextImage
src=https://d31wtm2rx76rut.cloudfront.net/1604303981874
alt="Khanna"
layout="fill" />