Environment: Vite (development & build-time)

boolean | string


Global
Provided by: vike

Vike's +host setting is just an alias for Vite's CLI --host option (which sets Vite's server.host and preview.host configuration).

This:

// +config.js
 
export default {
  host: true
}
// +config.ts
 
import type { Config } from 'vike/types'
 
export default {
  host: true
} satisfies Config

Is equivalent to that:

// vite.config.js
 
export default {
  server: {
    host: true
  },
  preview: {
    host: true
  }
}
// vite.config.ts
 
import type { Config } from 'vike/types'
 
export default {
  server: {
    host: true
  },
  preview: {
    host: true
  }
} satisfies Config

If you want to set two different values between development and preview, then set the values over vite.config.js instead of using +host.

See also