Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Nov 21, 2024
1 parent 74c75d0 commit cd9b4fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {
},

// @ts-ignore This hook only works in Vite 6
async configEnvironment(_, config, opts) {
async configEnvironment(name, config, opts) {
config.resolve ??= {};
// Emulate Vite default fallback for `resolve.conditions` if not set
if (config.resolve.conditions == null) {
// @ts-ignore These exports only exist in Vite 6
const { defaultClientConditions, defaultServerConditions } = await import('vite');
if (config.consumer === 'client' || opts.isSsrTargetWebworker) {
if (config.consumer === 'client' || name === 'client' || opts.isSsrTargetWebworker) {
config.resolve.conditions = [...defaultClientConditions];
} else {
config.resolve.conditions = [...defaultServerConditions];
Expand Down

0 comments on commit cd9b4fa

Please sign in to comment.