这是图片:
<img src="src/img/image.svg" alt="" />
文件夹结构如下:
src
-img
-components
...etc
但是图像什么也没显示,我在控制台中收到404错误?
答案 0 :(得分:2)
Gatsby looks for static assets in the static
folder at the root of your project,因此,如果您希望示例图像可以工作,并且不想使用Webpack模块系统,请确保图像位于static/src/img/image.svg
。