```js // @noErrors import { asset, assets, base, resolve, resolveRoute } from '$app/paths'; ``` ## asset Resolve the URL of an asset in your `static` directory, by prefixing it with [`config.kit.paths.assets`](/docs/kit/configuration#paths) 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. ```svelte a potato ```
```dts function asset(file: Asset): string; ```
## assets
Use `asset(...)` instead
An absolute path that matches [`config.kit.paths.assets`](/docs/kit/configuration#paths). > [!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.
```dts let assets: | '' | `https://${string}` | `http://${string}` | '/_svelte_kit_assets'; ```
## base
Use `resolve(...)` instead
A string that matches [`config.kit.paths.base`](/docs/kit/configuration#paths). Example usage: `Link`
```dts let base: '' | `/${string}`; ```
## resolve
Available since 2.22
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. ```js // @errors: 7031 import { resolve } from '$app/paths'; // using a pathname const resolved = resolve(`/blog/hello-world`); // using a route ID plus parameters const resolved = resolve('/blog/[slug]', { slug: 'hello-world' }); ```
```dts function resolve( ...args: ResolveArgs ): ResolvedPathname; ```
## resolveRoute
Use `resolve(...)` instead
```dts function resolveRoute( ...args: ResolveArgs ): ResolvedPathname; ```