feat(core): honor deploy base in static build - #555
Merged
Conversation
Thread the deploy base into buildStaticDevTools so the root redirect and dock-renderer import specifiers resolve under a subpath instead of the hardcoded /__devtools/. Activates the previously-unused --base CLI flag and picks up Vite's resolvedConfig.base on the plugin build path. Closes #554
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
antfu
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #554.
The static DevTools build hardcoded the absolute
/__devtools/mount path, so a snapshot deployed under a subpath (e.g./ci-build-123456/) redirected the browser to/__devtools/instead of/ci-build-123456/__devtools/and failed to load. Setting Vite'sbaseinvite.config.tshad no effect because the static-build code ignored it.The CLI
buildcommand already declared a--base <baseURL>flag, but it was collected intoBuildOptions.baseand never used.Change
Thread a deploy
basethroughbuildStaticDevToolsso the two root-relative URLs it bakes resolve under the subpath:index.htmlredirect, andWired from both entry points:
vite-devtools build) — activates the existing--baseflag.vite build) — picks upresolvedConfig.base, so settingbaseinvite.config.tsnow works.The reference viewer's own assets, connection meta, and RPC dump already resolve relative (
./) upstream, so they work under any base. Verified end-to-end: built with--base /ci-build-123456/, served under that subpath, and the SPA redirects correctly and renders with no load-blocking errors.Scope
This makes the primary DevTools SPA work at a subpath. Full subpath support for the integration sub-panels (Rolldown/Vite/Oxc) is out of scope here: each Nuxt sub-app bakes its own absolute base at its own build time, and the
devframe:docksdump carries absolute dock icon/url values whose derivation is owned upstream in@devframes/hub. Those warrant follow-up in the respective packages and upstream.This PR was created with the help of an agent.