fix(core): prevent duplicate plugins in standalone mode - #422
Closed
webfansplz wants to merge 1 commit into
Closed
Conversation
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes standalone-mode plugin initialization by deduplicating all plugins injected by DevTools() (not just those with the vite:devtools prefix), preventing duplicate setup/RPC registrations when the target project config also includes some of the same plugins.
Changes:
- Resolve standalone
DevTools()plugins once and dedupe resolved Vite plugins by exact injected plugin names. - Add unit tests for
dedupeVitePluginsto ensure injected plugins are deduped while unrelated user duplicates are preserved. - Remove redundant manual Devframe plugin mounts from the core playground config (since
DevTools()already mounts them).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/node/standalone.ts | Resolves DevTools() once and dedupes injected plugins by exact names. |
| packages/core/src/node/tests/standalone.test.ts | Adds coverage for the new name-based dedupe behavior. |
| packages/core/playground/vite.config.ts | Removes redundant manual mounts for built-in Devframe plugins in the playground. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
webfansplz
marked this pull request as draft
July 15, 2026 17:11
Member
Author
|
Waiting for #423 to be merged. |
Member
|
I wonder maybe we should have all launcher and devframe plugins wrapped into a single Vite plugin instead of polluting the Vite plugins pipeline EDIT: I made it in 3fbc896 |
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.
Context
play:standaloneresolves both the plugins declared in the playground Vite config and the plugins injected by the standalone launcher.The previous deduplication only matched plugin names starting with
vite:devtools. Devframe plugins and optional integrations use other names, so they could be initialized more than once, causing duplicate setup and RPC registrations.Changes
DevTools()plugins once and deduplicate using their exact plugin names.