docs: mention @vitejs/devtools/client/inject for explicit devtools client injection#266
Open
webfansplz wants to merge 1 commit intomainfrom
Open
docs: mention @vitejs/devtools/client/inject for explicit devtools client injection#266webfansplz wants to merge 1 commit intomainfrom
@vitejs/devtools/client/inject for explicit devtools client injection#266webfansplz wants to merge 1 commit intomainfrom
Conversation
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-rolldown
@vitejs/devtools-rpc
@vitejs/devtools-self-inspect
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces an explicit @vitejs/devtools/preamble entrypoint to allow DevTools client injection for apps that don’t use an index.html (e.g. micro-frontends), aligning with the request in #262.
Changes:
- Add a new Vite plugin (
DevToolsPreamble) that resolves@vitejs/devtools/preambleto a virtual module importing the DevTools client injector. - Refactor client injection URL creation into
getClientInjectUrl()and reuse it across injection mechanisms. - Document manual preamble usage for “no HTML entry” projects and wire up required dependency/exports changes.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds @rolldown/pluginutils to the workspace catalog for the new preamble plugin. |
| pnpm-lock.yaml | Locks @rolldown/pluginutils and adds it to packages/core deps. |
| packages/core/types/preamble.d.ts | Adds a type-only entry for the new ./preamble export. |
| packages/core/src/node/plugins/preamble.ts | Implements the virtual module resolver/loader for @vitejs/devtools/preamble. |
| packages/core/src/node/plugins/injection.ts | Extracts getClientInjectUrl() and uses it in transformIndexHtml. |
| packages/core/src/node/plugins/index.ts | Registers DevToolsPreamble alongside existing core plugins. |
| packages/core/package.json | Adds the ./preamble export and the new dependency. |
| docs/guide/index.md | Documents how to import the preamble when there is no HTML entry. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9148592 to
b7cdf34
Compare
antfu
reviewed
Mar 25, 2026
e3fce4e to
8fe4030
Compare
…ls client injection
8fe4030 to
0128f3f
Compare
@vitejs/devtools/preamble for explicit devtools client injection@vitejs/devtools/client/inject for explicit devtools client injection
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.
Close #262