[]previous and next page

Validation and precedence

Validation and precedence in the Configuration with dusk.config.ts guide.

For agentsUpdated
  • The build loads the file with Vite's own config loader and validates it. An unknown key is an error with a suggestion (did you mean "security"?), and a routing rule is checked the same way the server checks it. A bad file fails the build and names the file and the rule (dusk.config.ts: redirects[0].destination ...).
  • The server checks the same values again when the bundle loads, so a bad value never serves a request.
  • dusk({ ... }) wins over the file for the keys both have: adapter, prerender, and buildId (which wins over deploymentId).
  • The entry file's options (export const options in src/entry-server.ts, or its default export) are merged over the file's server options. The order, lowest first: the handler's defaults, dusk.config.ts, src/entry-server.ts, and then the values the generated entry fixes (the manifest, the mount point, the global error page, and envSource: false on a platform that passes its bindings). The merge is described in Merging the entry's options.
  • A leaf option set in both files with different values is reported once at build time, naming the leaf. The entry's value wins. See Conflicts.
  • In dusk dev a change to the file restarts the dev server by itself and prints dusk.config.ts changed, restarting the dev server.. The open page reloads once the server answers again. A file that fails to load keeps the configuration the server had until it is fixed. See Development: what hot reloads and what restarts.