-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vite6): re-apply default conditions if using vite 6 or later
Vite 6 no longer applies default conditions when you override resolve.conditions. This PR adds them back conditionally based on the vite version. Fixes #7070
- Loading branch information
thebanjomatic
committed
Jan 15, 2025
1 parent
b526896
commit 7bd7339
Showing
3 changed files
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as vite from 'vite' | ||
|
||
type Vite6Options = typeof vite & Partial<{ | ||
defaultServerConditions?: string[] | ||
}> | ||
|
||
export async function getDefaultServerConditions() { | ||
return (vite as Vite6Options).defaultServerConditions ?? ['node'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters