Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是一个非常简单的 SvelteKit 程序:
<img src="static/bird.jpg" alt="a bird"/>
当我用 运行它时npm run dev,会显示图像。但是当我使用npm run buildand时npm run preview,只显示替代文本。
npm run dev
npm run build
npm run preview
可能是什么原因?看起来像这样。
我使用 SvelteKit v1.0.0-next.107
我找到了解决方案:
<img src="/bird.jpg" alt="a bird"/>
没有static.
static