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'});
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.
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'});
2.26
reference}from'$app/paths';// using a pathnameconstresolvedconstresolved: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`);// using a route ID plus parametersconstresolvedconstresolved: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'});