Vike's +port setting is an alias for setting Vite's server.port and preview.port.

This:

// +config.js
 
export default {
  port: 1234
}

Is equivalent to that:

// vite.config.js
 
export default {
  server: {
    port: 1234
  },
  preview: {
    port: 1234
  }
}

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

See also