当我在本地进行开发时,将/public
文件夹放在/src/
中时会找到图像:
# locally
./src/public/images/
然后,当我进行部署时,找不到映像。但是,当我将公用文件夹放在src之外时,会发现图像:
# deploy
./public/images/
./src/
我将图像用作:
<img src="/images/my-image.jpg" alt="" />
我必须使用配置设置吗?
编辑:
完整结构:
|- .now/
| |- project.json
| └── README.txt
|- next.config.js
|- now.json
|- src/
| |- .next/
| | |- build-manifest.json
| | |- react-loadable-manifest.json
| | |- cache/
| | |- server/
| | └── static/
| |- pages/
| └── next-env.d.ts