[]previous and next page

devAllowedHostsOf

The hosts the dev server accepts in addition to localhost: dev.allowedHosts and the hosts the app declares in security.allowedHosts (they are the hosts it serves, so they work in development too), written the way Vite's server.allowedHosts reads them.

The hosts the dev server accepts in addition to localhost: dev.allowedHosts and the hosts the app declares in security.allowedHosts (they are the hosts it serves, so they work in development too), written the way Vite's server.allowedHosts reads them. Without either, undefined: Vite keeps its own default.

Import#

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

Signature#

ts
function devAllowedHostsOf(config: DuskConfig | undefined): true | string[] | undefined

Parameters#

Name Description
config A validated configuration (or undefined without a file).

Returns#

true for every host, a list of host patterns, or undefined.

Examples#

ts
devAllowedHostsOf({ security: { allowedHosts: ["*.example.com:8443"] } }); // [".example.com"]