[]previous and next page

DuskConfig

The whole configuration.

The whole configuration. Every key is optional.

Import#

ts
import type { DuskConfig } from "@shadow-js/dusk/vite";

Signature#

ts
interface DuskConfig extends RoutingConfig {
  /** The platform the build emits for (build time). A `dusk({ adapter })` option wins. */
  readonly adapter?: Adapter;
  readonly security?: DuskSecurityConfig;
  /**
   * Environment variables the server validates at start (see `defineEnv`). The key `public` is the
   * public environment contract ({@link DuskPublicEnvConfig}), not a variable.
   */
  readonly env?: DuskEnvShape;
  /**
   * Locales of the app. The default locale sets `<html lang>`; `i18n.routing` turns on automatic locale routing.
   */
  readonly i18n?: DuskI18nConfig;
  readonly image?: DuskImageConfig;
  /** Prerendering (build time). A `dusk({ prerender })` option wins. */
  readonly prerender?: false | PrerenderOptions;
  /** Named cache lifetimes; they add to or replace the presets. */
  readonly cacheLife?: Readonly<Record<string, CacheLifeProfile>>;
  readonly draftMode?: DuskDraftModeConfig;
  /** `false` turns off the `instrumentation.ts` convention. */
  readonly instrumentation?: false;
  /** Identifies the deployment; a client from another deployment is told to reload. A `dusk({ buildId })` option wins. */
  readonly deploymentId?: string;
  readonly skew?: { readonly reload?: boolean };
  /** Build-time settings of the client output. */
  readonly build?: DuskBuildConfig;
}

Members#

Name Type Description
adapter? readonly adapter?: Adapter The platform the build emits for (build time). A dusk({ adapter }) option wins.
security? readonly security?: DuskSecurityConfig
env? readonly env?: DuskEnvShape Environment variables the server validates at start (see defineEnv). The key public is the public environment contract (DuskPublicEnvConfig), not a variable.
i18n? readonly i18n?: DuskI18nConfig Locales of the app. The default locale sets <html lang>; i18n.routing turns on automatic locale routing.
image? readonly image?: DuskImageConfig
prerender? readonly prerender?: false | PrerenderOptions Prerendering (build time). A dusk({ prerender }) option wins.
cacheLife? readonly cacheLife?: Readonly<Record<string, CacheLifeProfile>> Named cache lifetimes; they add to or replace the presets.
draftMode? readonly draftMode?: DuskDraftModeConfig
instrumentation? readonly instrumentation?: false false turns off the instrumentation.ts convention.
deploymentId? readonly deploymentId?: string Identifies the deployment; a client from another deployment is told to reload. A dusk({ buildId }) option wins.
skew? readonly skew?: { readonly reload?: boolean }
build? readonly build?: DuskBuildConfig Build-time settings of the client output.