DuskManifest
The JSON file dusk-manifest.json.
The JSON file dusk-manifest.json.
Import#
ts
import type { DuskManifest } from "@shadow-js/dusk/vite";
Signature#
ts
interface DuskManifest {
readonly version: 1;
readonly buildId: string;
readonly base: string;
/** The build's assets folder (Vite's `build.assetsDir`, `assets` by default). Adapters derive their immutable rules from it. */
readonly assetsDir: string;
readonly entry: string;
readonly css: readonly string[];
readonly routes: Readonly<
Record<
string,
{
readonly kind: "page" | "layout";
readonly file: string;
/** The URL pattern of the route (`/posts/:id`, a layout's folder prefix). */
readonly path: string;
readonly preload: readonly string[];
readonly ssr?: boolean | "data-only";
readonly prerender?: boolean | readonly string[];
/** `export const dynamicParams` of the page, when it sets one: `false` makes a param its list omits not found. */
readonly dynamicParams?: boolean;
/** `revalidate` of the route in seconds (ISR), when it sets one. */
readonly revalidate?: number;
}
>
>;
readonly api: readonly {
readonly id: string;
readonly file: string;
readonly methods: readonly string[];
}[];
/** The stream routes (`SSE` and `WS` exports): the URL pattern and the kinds the module exports. */
readonly streams: readonly {
readonly id: string;
readonly path: string;
readonly kinds: readonly string[];
}[];
/** The `_middleware` files, relative to the project root. Each one covers the routes in its folder and below. */
readonly middleware: readonly { readonly file: string }[];
readonly serverFns: Readonly<
Record<
string,
{ readonly file: string; readonly export: string; readonly method: "GET" | "POST" }
>
>;
readonly prerendered: readonly string[];
/**
* How each prerendered page is answered (B2): a file with its headers, or the handler per request. Written when the
* build prerendered pages; the static layers of the Node, Bun and Deno runtimes and `dusk start` read it.
*/
readonly staticPages?: readonly StaticPage[];
/**
* The adapter the build used, when it has one: its name and its output folder. `dusk start` reads it to know whether
* the build runs on the Node adapter. Absent when the app has no adapter.
*/
readonly adapter?: { readonly name: string; readonly outDir: string };
}
Members#
| Name | Type | Description |
|---|---|---|
version |
readonly version: 1 |
|
buildId |
readonly buildId: string |
|
base |
readonly base: string |
|
assetsDir |
readonly assetsDir: string |
The build's assets folder (Vite's build.assetsDir, assets by default). Adapters derive their immutable rules from it. |
entry |
readonly entry: string |
|
css |
readonly css: readonly string[] |
|
routes |
readonly routes: Readonly< Record< string, { readonly kind: "page" | "layout"; readonly file: string; /** The URL pattern of the route (`/posts/:id`, a layout's folder prefix). */ readonly path: string; readonly preload: readonly string[]; readonly ssr?: boolean | "data-only"; readonly prerender?: boolean | readonly string[]; /** `export const dynamicParams` of the page, when it sets one: `false` makes a param its list omits not found. */ readonly dynamicParams?: boolean; /** `revalidate` of the route in seconds (ISR), when it sets one. */ readonly revalidate?: number; } > > |
|
api |
readonly api: readonly { readonly id: string; readonly file: string; readonly methods: readonly string[]; }[] |
|
streams |
readonly streams: readonly { readonly id: string; readonly path: string; readonly kinds: readonly string[]; }[] |
The stream routes (SSE and WS exports): the URL pattern and the kinds the module exports. |
middleware |
readonly middleware: readonly { readonly file: string }[] |
The _middleware files, relative to the project root. Each one covers the routes in its folder and below. |
serverFns |
readonly serverFns: Readonly< Record< string, { readonly file: string; readonly export: string; readonly method: "GET" | "POST" } > > |
|
prerendered |
readonly prerendered: readonly string[] |
|
staticPages? |
readonly staticPages?: readonly StaticPage[] |
How each prerendered page is answered (B2): a file with its headers, or the handler per request. Written when the build prerendered pages; the static layers of the Node, Bun and Deno runtimes and dusk start read it. |
adapter? |
readonly adapter?: { readonly name: string; readonly outDir: string } |
The adapter the build used, when it has one: its name and its output folder. dusk start reads it to know whether the build runs on the Node adapter. Absent when the app has no adapter. |