Resolve the URL of an asset in your static directory, by prefixing it with config.kit.paths.assets if configured, or otherwise by prefixing it with the base path.
During server rendering, the base path is relative and depends on the page currently being rendered.
[!NOTE] If a value for config.kit.paths.assets is specified, it will be replaced with '/_svelte_kit_assets' during vite dev or vite preview, since the assets don't yet live at their eventual URL.
Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters.
During server rendering, the base path is relative and depends on the page currently being rendered.
import{resolve}from'$app/paths';// using a pathnameconstresolved=resolve(`/blog/hello-world`);// using a route ID plus parametersconstresolved=resolve('/blog/[slug]',{slug:'hello-world'});
Résout l’URL d’un asset se trouvant dans votre dossier static, en le préfixant avec
config.kit.paths.assets si configuré, ou avec le chemin de base
sinon.
Lors du rendu côté serveur, le chemin de base est relatif et dépend de la page en train d’être
rendue.
Si une valeur de config.kit.paths.assets est fournie, elle sera remplacé par
'/_svelte_kit_assets' lors de vite dev ou vite preview, puisque les assets ne sont pas
encore placés sur leur URL future.
Résout un chemin en le préfixant avec le chemin de base, s’il existe, ou avec un ID de route en
remplissant les segments dynamiques avec des paramètres.
Lors du rendu côté serveur, le chemin de base est relatif et dépend de la page en train d’être
rendue.
Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters.
During server rendering, the base path is relative and depends on the page currently being rendered.
import{resolve}from'$app/paths';// using a pathnameconstresolved=resolve(`/blog/hello-world`);// using a route ID plus parametersconstresolved=resolve('/blog/[slug]',{slug:'hello-world'});
2.26
reference}from'$app/paths';// avec un chemin
constresolvedconstresolved:string=resolve(alias)resolve<"/blog/hello-world">(route:"/blog/hello-world",params:Record<string,string>):ResolvedPathnameimportresolve
Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters.
During server rendering, the base path is relative and depends on the page currently being rendered.
import{resolve}from'$app/paths';// using a pathnameconstresolved=resolve(`/blog/hello-world`);// using a route ID plus parametersconstresolved=resolve('/blog/[slug]',{slug:'hello-world'});
2.26
reference(`/blog/hello-world`);// avec un ID de route et ses paramètresconstresolvedconstresolved:string=resolve(alias)resolve<"/blog/[slug]">(route:"/blog/[slug]",params:Record<string,string>):ResolvedPathnameimportresolve
Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters.
During server rendering, the base path is relative and depends on the page currently being rendered.
import{resolve}from'$app/paths';// using a pathnameconstresolved=resolve(`/blog/hello-world`);// using a route ID plus parametersconstresolved=resolve('/blog/[slug]',{slug:'hello-world'});