preview.host
- Type:
string | boolean - Default:
server.host
0.0.0.0 or true to listen on all addresses, including LAN and public addresses.
This can be set via the CLI using --host 0.0.0.0 or --host.
There are cases when other servers might respond instead of Vite.
See
server.host for more details.preview.allowedHosts
- Type:
string[] | true - Default:
server.allowedHosts
server.allowedHosts for more details.
preview.port
- Type:
number - Default:
4173
preview.strictPort
- Type:
boolean - Default:
server.strictPort
true to exit if port is already in use, instead of automatically trying the next available port.
preview.https
- Type:
https.ServerOptions - Default:
server.https
server.https for more details.
preview.open
- Type:
boolean | string - Default:
server.open
process.env.BROWSER (e.g. firefox). You can also set process.env.BROWSER_ARGS to pass additional arguments (e.g. --incognito).
BROWSER and BROWSER_ARGS are also special environment variables you can set in the .env file to configure it. See the open package for more details.
preview.proxy
- Type:
Record<string, string | ProxyOptions> - Default:
server.proxy
{ key: options } pairs. If the key starts with ^, it will be interpreted as a RegExp. The configure option can be used to access the proxy instance.
Uses http-proxy-3. Full options here.
preview.cors
- Type:
boolean | CorsOptions - Default:
server.cors
server.cors for more details.
preview.headers
- Type:
OutgoingHttpHeaders