Skip to content

feat(core): environments devtools config#296

Draft
webfansplz wants to merge 1 commit intomainfrom
feat/environment
Draft

feat(core): environments devtools config#296
webfansplz wants to merge 1 commit intomainfrom
feat/environment

Conversation

@webfansplz
Copy link
Copy Markdown
Member

@webfansplz webfansplz commented Apr 21, 2026

Be related to #292.

Extend devtools config to support an environments option, then add the Vite-side integration in the Vite repo.
That way, Vite can enable DevTools only for the selected environments to avoid unnecessary overhead for environments that are not opted in.

Copilot AI review requested due to automatic review settings April 21, 2026 14:57
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 21, 2026

Open in StackBlitz

@vitejs/devtools

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

@vitejs/devtools-kit

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

@vitejs/devtools-rolldown

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

@vitejs/devtools-rpc

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

@vitejs/devtools-self-inspect

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

commit: 69f8bce

Copy link
Copy Markdown
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

Adds an environments option to the DevTools core config type so Vite (and other consumers) can scope DevTools enablement to specific environments and avoid unnecessary analysis overhead.

Changes:

  • Extend DevToolsConfig with an optional environments?: string[] field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/node/config.ts
/**
* Vite environments to enable DevTools for. Defaults to all environments.
*/
environments?: string[]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where is the implemeation of using it?

Copy link
Copy Markdown
Member Author

@webfansplz webfansplz Apr 21, 2026

Choose a reason for hiding this comment

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

It will be used in the Vite repo. See: vitejs/vite#22290

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if this should be controlled by the plugin (here) instead in the Vite repo. I think the less coupling with the Vite repo the better.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree. Most of the current Vite core integration is handled on the DevTools side. But the check for enabling the Rolldown debug log (https://github.com/vitejs/vite/blob/main/packages/vite/src/node/config.ts#L2071) — which is also where most of the build analysis time is spent — happens in Vite core. Given the current setup, where standalone DevTools is launched during Vite core’s build time, this part also seems like it has to be handled in Vite core.

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.

3 participants