Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How to properly address Images and assets in sveltekit

$
0
0

i am totaly newbi in sveltekit,

my main question is : Where to put images with SvelteKit? and how use it.in static folder, right?

But this causes a problem:when in this route : "@domain/dashboard" ,I use this code:

<img src="user.png" />

it try to find it in @domain/user.png and everything is ok!but when i use this route: @domain/users/1it try to find it in @domain/users/user.png exept @domain/user.png.

please help me.

ps: i see there is topics that recommend use something like this:

import logo from '$lib/assets/user.png';

so if i copy images into lib folder, What is the reason for static folder?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>