Skip to content

feat(plugin-vite): support custom server host in renderer dev server URL - #4363

Merged
erickzhao merged 1 commit into
nextfrom
claude/pr-4030-review-wnavnm
Sep 2, 2026
Merged

feat(plugin-vite): support custom server host in renderer dev server URL#4363
erickzhao merged 1 commit into
nextfrom
claude/pr-4030-review-wnavnm

Conversation

@erickzhao

Copy link
Copy Markdown
Member
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

Ports #4030 by @ChenJiaH onto the next branch. Credit for the original change goes to @ChenJiaH (also credited via Co-authored-by on the commit).

Previously, the Vite plugin hardcoded the development server URL exposed to the main process (via the <NAME>_VITE_DEV_SERVER_URL define constant) to http://localhost:<port>. This prevented developers from using custom host addresses for the Vite dev server, which is useful for:

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

The URL now respects a string server.host from the resolved Vite config. On top of the original PR, this port adds:

  • Wildcard hosts (true, '0.0.0.0', '::') are normalized to localhost, since the main process runs on the same machine and wildcard addresses are not reliably loadable in Chromium (http://:::5173 is not even a valid URL).
  • IPv6 literal hosts are wrapped in brackets to form valid URLs.
  • Test coverage in vite.base.config.spec.ts for both a custom string host and the wildcard fallback.

🤖 Generated with Claude Code

https://claude.ai/code/session_012hunyjnAGo97Vz7v2XgVJt


Generated by Claude Code

Previously, the Vite plugin hardcoded the development server URL exposed
to the main process to http://localhost:<port>, which prevented custom
host configurations (network debugging across devices, Docker container
development, remote development setups).

The URL now respects a string `server.host` from the resolved Vite
config. Wildcard hosts (`true`, `0.0.0.0`, `::`) fall back to
`localhost`, since the main process runs on the same machine and
wildcard addresses are not reliably loadable in Chromium, and IPv6
literals are bracketed to form valid URLs.

Ported from #4030 onto the `next` branch, with wildcard/IPv6
normalization and test coverage added.

Co-authored-by: chenjiahao <chenjiahao@jd.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012hunyjnAGo97Vz7v2XgVJt
@erickzhao
erickzhao requested a review from a team as a code owner September 2, 2026 18:18
@github-actions github-actions Bot added the next label Sep 2, 2026
@erickzhao
erickzhao merged commit f9c705d into next Sep 2, 2026
14 checks passed
@erickzhao
erickzhao deleted the claude/pr-4030-review-wnavnm branch September 2, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants