DuskOptions
Options of dusk.
Options of dusk.
Import#
ts
import type { DuskOptions } from "@shadow-js/dusk/vite";
Signature#
ts
interface DuskOptions {
/** Source folder relative to the project root. Default `src`. */
readonly srcDir?: string;
/** Build output folder relative to the project root; gets `client/` and `server/`. Default `dist`. */
readonly outDir?: string;
/** Options of the `shadow()` compiler plugin. */
readonly shadow?: ShadowPluginOptions;
/** Options of the file-route plugin. `routesDir` defaults to `<srcDir>/routes`. */
readonly router?: ShadowRouterOptions;
/** Import protection rules, besides the built-in conventions. */
readonly importProtection?: false | ImportProtectionOptions;
/** Prerendering at build time. `false` turns it off. */
readonly prerender?: false | PrerenderOptions;
/** Most preload entries per route in the manifest. Default 24. */
readonly maxPreloadsPerRoute?: number;
/** Build id baked into the manifest. Default: a hash of the client assets. */
readonly buildId?: string;
/**
* The platform the build emits for, after the bundles are written: `node()`, `bun()`, `deno()`,
* `cloudflare()`, `vercel()`, `netlify()`, `tarout()` or `staticSite()` from their subpaths.
* Without it the build writes `dist/client`, `dist/server` and `dusk-manifest.json` only.
*/
readonly adapter?: Adapter;
/**
* The origin the built client assets (the bundles, the CSS, and the files of the assets folder) are served from, for a
* CDN, such as `https://cdn.example`. The pages and the modules point there; the routes, the public files and the
* server stay on the app's own origin. The CDN must serve the files at `<origin><base><file>`. Default: same origin.
*/
readonly assetOrigin?: string;
}
Members#
| Name | Type | Description |
|---|---|---|
srcDir? |
readonly srcDir?: string |
Source folder relative to the project root. Default src. |
outDir? |
readonly outDir?: string |
Build output folder relative to the project root; gets client/ and server/. Default dist. |
shadow? |
readonly shadow?: ShadowPluginOptions |
Options of the shadow() compiler plugin. |
router? |
readonly router?: ShadowRouterOptions |
Options of the file-route plugin. routesDir defaults to <srcDir>/routes. |
importProtection? |
readonly importProtection?: false | ImportProtectionOptions |
Import protection rules, besides the built-in conventions. |
prerender? |
readonly prerender?: false | PrerenderOptions |
Prerendering at build time. false turns it off. |
maxPreloadsPerRoute? |
readonly maxPreloadsPerRoute?: number |
Most preload entries per route in the manifest. Default 24. |
buildId? |
readonly buildId?: string |
Build id baked into the manifest. Default: a hash of the client assets. |
adapter? |
readonly adapter?: Adapter |
The platform the build emits for, after the bundles are written: node(), bun(), deno(), cloudflare(), vercel(), netlify(), tarout() or staticSite() from their subpaths. Without it the build writes dist/client, dist/server and dusk-manifest.json only. |
assetOrigin? |
readonly assetOrigin?: string |
The origin the built client assets (the bundles, the CSS, and the files of the assets folder) are served from, for a CDN, such as https://cdn.example. The pages and the modules point there; the routes, the public files and the server stay on the app's own origin. The CDN must serve the files at <origin><base><file>. Default: same origin. |