```js // @noErrors import { asset, assets, base, resolve, resolveRoute } from '$app/paths'; ``` ## asset
Available since 2.26Resolve 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
Use [`asset(...)`](/docs/kit/$app-paths#asset) insteadAn 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.
Use [`resolve(...)`](/docs/kit/$app-paths#resolve) insteadA string that matches [`config.kit.paths.base`](/docs/kit/configuration#paths). Example usage: `Link`
Available since 2.26Resolve 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' }); ```
Use [`resolve(...)`](/docs/kit/$app-paths#resolve) instead