Conversation
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-rolldown
@vitejs/devtools-rpc
@vitejs/devtools-self-inspect
commit: |
There was a problem hiding this comment.
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
DevToolsConfigwith an optionalenvironments?: string[]field.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
788a667 to
69f8bce
Compare
| /** | ||
| * Vite environments to enable DevTools for. Defaults to all environments. | ||
| */ | ||
| environments?: string[] |
There was a problem hiding this comment.
Where is the implemeation of using it?
There was a problem hiding this comment.
It will be used in the Vite repo. See: vitejs/vite#22290
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Be related to #292.
Extend devtools config to support an
environmentsoption, 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.