Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Vite 6, the top-level
resolve.conditions
only apply to the client environment, so to apply in all environments generically, we need to use the newconfigEnvironment
hook. https://main.vite.dev/guide/migration.html#default-value-for-resolve-conditionsI adapted this change from sveltejs/vite-plugin-svelte#1020. I also remove the part where it updates the
development
andbrowser
conditions for Vite 6. I've not tested them with Vite 6, but I feel like it could interfere with the default behaviour.In practice I don't think a plugin should be modifying that. For
development
, Vite should decide by itself based onNODE_ENV
. Forbrowser
, that seems Vitest specific and I'm not sure Vite plugins should be hardcoding Vitest specific logic.