Skip to content

Analyze only the "client" environment (by default) #292

@silvenon

Description

@silvenon

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions