Thursday, May 5, 2022

[FIXED] Where to put images with Svelte Kit

Issue

I have been using Svelte for a little while and now I have switched to Svelte Kit so I can add multiple pages. I want to add some images to my site but I don't know where to put them. In Svelte I would just put them in public/images but there is no public folder with Svelte Kit (I set it up with npm init svelte@next my-app if that matters). Would I put them in static?

Thanks!


Solution

I added the images in the static folder and referenced them with /images/photo.jpg like @b2m9 said and it works perfectly.



Answered By - Anders
Answer Checked By - Gilberto Lyons (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.