Analyze only the "client" environment (by default)
Clear and concise description of the problem
I'm building both "ssr" and "client" using Vite Environment API. It seems like DevTools is spending a lot of time analyzing both bundles when it doesn't need to analyze the ssr environment at all. I would love if there was a way to select only client considering that Environments are beginning to be quite popular (RSC, Cloudflare etc.)
Suggested solution
Additional devtools.environments option which by default could be ['client']. This way the simplicity of devtools: true could remain if someone wanted only the client environment.
Alternative
I was thinking of maybe as a consumer doing it myself by importing the DevTools plugin and manually filtering the plugin to client using applyToEnvironment, but I'd need to get acquainted with some of the internals for that because DevTools() doesn't return a single plugin object.
So no substantial alterantive really comes to mind.
Additional context
No response
Validations
- [x] Follow our Code of Conduct
- [x] Read the Contributing Guide.
- [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Hi @silvenon , can you try [email protected] and @vitejs/[email protected] ?
Great, appears to have skipped my ssr environment!
But what is this new session where vite.config.ts is the entry?
Great, appears to have skipped my
ssrenvironment!But what is this new session where
vite.config.tsis the entry?
![]()
This is an unknown session generated by rolldown. You can ignore it and focus only on the session generated by your app entry.
Ok, if that's expected, then my feature request has been fulfilled. Thank you!
I should note that at first I had two servers running, I assume one for each environment, which sounds to me like a bug because it's worse experience for people using Environments, and IIRC one of those URLs didn't work.
Then when I selected the environment I wanted via environments: ["client"] everything was fine.
I'll raise it in a separate bug report, I just have to remember 😅
at first I had two servers running
Ah, this was because I also had devtools enabled in one of the environments, I forgot to exclude it, but I noticed in the meantime that you made devtools top-level-only, which is great! 💯 Now nobody can make a mistake like this anymore.
