Skip to content

feat(plugin-vite): support server host in renderer#4030

Open
ChenJiaH wants to merge 2 commits intoelectron:mainfrom
ChenJiaH:feat/support-server-host
Open

feat(plugin-vite): support server host in renderer#4030
ChenJiaH wants to merge 2 commits intoelectron:mainfrom
ChenJiaH:feat/support-server-host

Conversation

@ChenJiaH
Copy link

Previously, the Electron Forge Vite plugin hardcoded the development server URL to use localhost when exposing the renderer process URL to the main process. This limitation prevented developers from configuring custom host addresses for the Vite development server, which is essential for scenarios such as:

  • Network debugging across different devices
  • Docker container development environments
  • Custom network configurations
  • Remote development setups

@ChenJiaH ChenJiaH requested a review from a team as a code owner October 13, 2025 08:56
Copy link
Member

@BlackHole1 BlackHole1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just have a small nit

Comment on lines +88 to +89
const configHost = server.config.server?.host
const devHost = typeof configHost === 'string' ? configHost : 'localhost'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const configHost = server.config.server?.host
const devHost = typeof configHost === 'string' ? configHost : 'localhost'
const devHost = server.config.server?.host ?? 'localhost'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments