Skip to content

feat(devtools): drive Vite DevTools through the devtools config option on Vite 8.3+ - #1091

Merged
antfu merged 2 commits into
mainfrom
feat/vite-devtools-config-integration
Sep 14, 2026
Merged

antfu merged 2 commits into
mainfrom
feat/vite-devtools-config-integration

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

📚 Description

Vite 8.3 registers the Vite DevTools integration itself from the top-level devtools config option (vitejs/vite#23333). This PR detects the running Vite version:

  • Vite ≥ 8.3 — Nuxt DevTools no longer installs the DevTools() plugin manually. It seeds the Vite devtools config option (branding, and clientAuth for disableAuthorization) and lets Vite core load the integration. This puts the toggle in user hands: vite: { devtools: false } in nuxt.config turns Vite DevTools off, and user-provided devtools config keys win over our defaults.
  • Vite < 8.3 — falls back to lazily importing @vitejs/devtools and registering the DevTools() plugin, as before.

Verified against playgrounds-ecosystem/:

  • nuxt5 (Nuxt 5 nightly, now pinned to Vite 8.3 via override): hub mounted at /__devtools/ with Nuxt branding in __connection.json, dock (devframes-dock-embedded) renders in the browser, Nuxt client served at /__nuxt_devtools__/client/; with vite: { devtools: false } the hub is not mounted. build + typecheck pass.
  • nuxt4 (Nuxt 4.5.1 / Vite 8.1.5): manual-plugin fallback still mounts the hub with Nuxt branding and the dock renders. build + typecheck pass.

Also documents the new toggle in the v4 migration guide.


This PR was created with the help of an agent.

…ion on Vite 8.3+

Vite 8.3 registers the Vite DevTools integration itself from the top-level
`devtools` config option (vitejs/vite#23333), so configure it there instead
of installing the `DevTools()` plugin manually — users can now toggle the
integration off with `vite: { devtools: false }` in `nuxt.config`. Older
Vite versions keep the lazily installed plugin as a fallback.

The nuxt5 ecosystem playground now pins Vite 8.3+ to exercise the
config-driven path; nuxt4 stays on Vite 8.1 to cover the fallback.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2893b48
Status: ✅  Deploy successful!
Preview URL: https://be8afd28.nuxt-devtools.pages.dev
Branch Preview URL: https://feat-vite-devtools-config-in.nuxt-devtools.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 96d963f1-b0a6-47c1-8266-8f86f10000f3

📥 Commits

Reviewing files that changed from the base of the PR and between 64376ec and 2893b48.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • pnpm-workspace.yaml

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The module now detects the Vite version and configures DevTools through Vite’s top-level devtools option for Vite 8.3 and later. It preserves manual plugin registration for older versions. A helper handles disabled, missing, and boolean devtools settings. Authorization and branding use the shared configuration path. Migration documentation and the Nuxt 5 playground cover the version-specific behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2893b

No concrete current-head issue remains that should block merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: configuring Vite DevTools through the devtools option for Vite 8.3 and newer.
Description check ✅ Passed The description directly explains the Vite 8.3 integration, the older-version fallback, the new disable option, documentation changes, and verification results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/vite-devtools-config-integration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@antfu
antfu merged commit c286768 into main Sep 14, 2026
8 of 9 checks passed
@antfu
antfu deleted the feat/vite-devtools-config-integration branch September 14, 2026 04:51
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