$app/paths
import { let assets: "" | `https://${string}` | `http://${string}` | "/_svelte_kit_assets"
An absolute path that matches config.kit.paths.assets
.
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.
assets, let base: "" | `/${string}`
A string that matches config.kit.paths.base
.
Example usage: <a href="{base}/your-page">Link</a>
base, function resolveRoute(id: string, params: Record<string, string | undefined>): string
Populate a route ID with params to resolve a pathname.
resolveRoute } from '$app/paths';
assets
An absolute path that matches config.kit.paths.assets
.
If a value for
config.kit.paths.assets
is specified, it will be replaced with'/_svelte_kit_assets'
duringvite dev
orvite preview
, since the assets don’t yet live at their eventual URL.
let assets:
| ''
| `https://${string}`
| `http://${string}`
| '/_svelte_kit_assets';
base
A string that matches config.kit.paths.base
.
Example usage: <a href="{base}/your-page">Link</a>
let base: '' | `/${string}`;
resolveRoute
Populate a route ID with params to resolve a pathname.
import { function resolveRoute(id: string, params: Record<string, string | undefined>): string
Populate a route ID with params to resolve a pathname.
resolveRoute } from '$app/paths';
function resolveRoute(id: string, params: Record<string, string | undefined>): string
Populate a route ID with params to resolve a pathname.
resolveRoute(
`/blog/[slug]/[...somethingElse]`,
{
slug: string
slug: 'hello-world',
somethingElse: string
somethingElse: 'something/else'
}
); // `/blog/hello-world/something/else`
function resolveRoute(
id: string,
params: Record<string, string | undefined>
): string;