Resolve the URL of an asset in your static directory, by prefixing it with config.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.
Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters.
In hash routing mode, the returned URL starts with #.
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.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.
Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters.
In hash routing mode, the returned URL starts with #.
During server rendering, the base path is relative and depends on the page currently being rendered.
Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters.
In hash routing mode, the returned URL starts with #.
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">(pathname:"blog/hello-world"):ResolvedPathnameimportresolve
Resolve a pathname by prefixing it with the base path, if any, or resolve a route ID by populating dynamic segments with parameters.
In hash routing mode, the returned URL starts with #.
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.
In hash routing mode, the returned URL starts with #.
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'});