Skip to main content

$app/manifest

import { 
const assets: {
    path: import("$app/types").AssetPath;
}[]

An array of { path: AssetPath } objects representing the files in your static directory, or whatever directory is specified by config.files.assets. The path is relative to the base path, and can be used with asset(...).

assets
,
const immutable: {
    path: string;
}[]

An array of { path: string } objects representing the files generated by Vite. The path is relative to the base path, and is intended for use with cache.add(...) inside a service worker. During development, this is an empty array.

immutable
,
const prerendered: {
    path: import("$app/types").Path;
}[]

An array of { path: Path } objects representing prerendered pages and endpoints, relative to the base path. During development, this is an empty array.

prerendered
, const routes: ManifestRoute[]

An array of objects representing the routes in your app. Only routes that the router can match are included — directories that merely hold a +layout are not routes of their own.

Each object has an id, plus page and endpoint booleans describing whether the route has a +page and/or a +server. Both are true for a route that has both, so the capabilities can be filtered independently:

import { routes } from '$app/manifest';

const pages = routes.filter((route) => route.page);
const endpoints = routes.filter((route) => route.endpoint);
routes
} from '$app/manifest';

This module is available to service workers and other contexts. It exports information about the build output, static files, prerendered pages, and routes.

assets

An array of { path: AssetPath } objects representing the files in your static directory, or whatever directory is specified by config.files.assets. The path is relative to the base path, and can be used with asset(...).

const assets: Array<{
	path: import('$app/types').AssetPath;
}>;

immutable

An array of { path: string } objects representing the files generated by Vite. The path is relative to the base path, and is intended for use with cache.add(...) inside a service worker. During development, this is an empty array.

const immutable: Array<{ path: string }>;

prerendered

An array of { path: Path } objects representing prerendered pages and endpoints, relative to the base path. During development, this is an empty array.

const prerendered: Array<{
	path: import('$app/types').Path;
}>;

routes

An array of objects representing the routes in your app. Only routes that the router can match are included — directories that merely hold a +layout are not routes of their own.

Each object has an id, plus page and endpoint booleans describing whether the route has a +page and/or a +server. Both are true for a route that has both, so the capabilities can be filtered independently:

import { const routes: ManifestRoute[]

An array of objects representing the routes in your app. Only routes that the router can match are included — directories that merely hold a +layout are not routes of their own.

Each object has an id, plus page and endpoint booleans describing whether the route has a +page and/or a +server. Both are true for a route that has both, so the capabilities can be filtered independently:

import { routes } from '$app/manifest';

const pages = routes.filter((route) => route.page);
const endpoints = routes.filter((route) => route.endpoint);
routes
} from '$app/manifest';
const
const pages: ({
    id: Exclude<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: false;
} | {
    id: Extract<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: true;
})[]
pages
= const routes: ManifestRoute[]

An array of objects representing the routes in your app. Only routes that the router can match are included — directories that merely hold a +layout are not routes of their own.

Each object has an id, plus page and endpoint booleans describing whether the route has a +page and/or a +server. Both are true for a route that has both, so the capabilities can be filtered independently:

import { routes } from '$app/manifest';

const pages = routes.filter((route) => route.page);
const endpoints = routes.filter((route) => route.endpoint);
routes
.
Array<ManifestRoute>.filter<{
    id: Exclude<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: false;
} | {
    id: Extract<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: true;
}>(predicate: (value: ManifestRoute, index: number, array: ManifestRoute[]) => value is {
    id: Exclude<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: false;
} | {
    id: Extract<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: true;
}, thisArg?: any): ({
    id: Exclude<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: false;
} | {
    id: Extract<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: true;
})[] (+1 overload)

Returns the elements of an array that meet the condition specified in a callback function.

@param
predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
@param
thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
filter
((route: ManifestRouteroute) => route: ManifestRouteroute.page: booleanpage);
const
const endpoints: ({
    id: Exclude<import("$app/types").EndpointRouteId, import("$app/types").PageRouteId>;
    page: false;
    endpoint: true;
} | {
    id: Extract<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: true;
})[]
endpoints
= const routes: ManifestRoute[]

An array of objects representing the routes in your app. Only routes that the router can match are included — directories that merely hold a +layout are not routes of their own.

Each object has an id, plus page and endpoint booleans describing whether the route has a +page and/or a +server. Both are true for a route that has both, so the capabilities can be filtered independently:

import { routes } from '$app/manifest';

const pages = routes.filter((route) => route.page);
const endpoints = routes.filter((route) => route.endpoint);
routes
.
Array<ManifestRoute>.filter<{
    id: Exclude<import("$app/types").EndpointRouteId, import("$app/types").PageRouteId>;
    page: false;
    endpoint: true;
} | {
    id: Extract<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: true;
}>(predicate: (value: ManifestRoute, index: number, array: ManifestRoute[]) => value is {
    id: Exclude<import("$app/types").EndpointRouteId, import("$app/types").PageRouteId>;
    page: false;
    endpoint: true;
} | {
    id: Extract<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: true;
}, thisArg?: any): ({
    id: Exclude<import("$app/types").EndpointRouteId, import("$app/types").PageRouteId>;
    page: false;
    endpoint: true;
} | {
    id: Extract<import("$app/types").PageRouteId, import("$app/types").EndpointRouteId>;
    page: true;
    endpoint: true;
})[] (+1 overload)

Returns the elements of an array that meet the condition specified in a callback function.

@param
predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
@param
thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
filter
((route: ManifestRouteroute) => route: ManifestRouteroute.endpoint: booleanendpoint);
const routes: ManifestRoute[];

ManifestRoute

A route in your app, along with its capabilities. page indicates the presence of a +page, while endpoint indicates the presence of a +server. Both are true when both files exist.

type ManifestRoute =
	| {
			id: Exclude<
				import('$app/types').PageRouteId,
				import('$app/types').EndpointRouteId
			>;
			page: true;
			endpoint: false;
	  }
	| {
			id: Exclude<
				import('$app/types').EndpointRouteId,
				import('$app/types').PageRouteId
			>;
			page: false;
			endpoint: true;
	  }
	| {
			id: Extract<
				import('$app/types').PageRouteId,
				import('$app/types').EndpointRouteId
			>;
			page: true;
			endpoint: true;
	  };

Edit this page on GitHub llms.txt