Skip to content

docs: mention @vitejs/devtools/client/inject for explicit devtools client injection#266

Open
webfansplz wants to merge 1 commit intomainfrom
feat/preamble
Open

docs: mention @vitejs/devtools/client/inject for explicit devtools client injection#266
webfansplz wants to merge 1 commit intomainfrom
feat/preamble

Conversation

@webfansplz
Copy link
Member

Close #262

Copilot AI review requested due to automatic review settings March 25, 2026 15:32
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 25, 2026

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@266

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@266

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@266

@vitejs/devtools-rpc

npm i https://pkg.pr.new/@vitejs/devtools-rpc@266

@vitejs/devtools-self-inspect

npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@266

commit: 0128f3f

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/preamble to 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.

@webfansplz webfansplz force-pushed the feat/preamble branch 3 times, most recently from 9148592 to b7cdf34 Compare March 25, 2026 16:17
@webfansplz webfansplz force-pushed the feat/preamble branch 2 times, most recently from e3fce4e to 8fe4030 Compare March 25, 2026 16:35
@webfansplz webfansplz changed the title feat(core): introduce @vitejs/devtools/preamble for explicit devtools client injection docs: mention @vitejs/devtools/client/inject for explicit devtools client injection Mar 25, 2026
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.

Support builds without index.html

3 participants