Skip to content

Commit

Permalink
fix: respect resolve.conditions, when resolving browser/require field (
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Sep 22, 2022
1 parent df560b0 commit 9a83eaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,8 @@ function resolveExports(
}

return _resolveExports(pkg, key, {
browser: targetWeb,
require: options.isRequire,
browser: targetWeb && !conditions.includes('node'),
require: options.isRequire && !conditions.includes('import'),
conditions
})
}
Expand Down

0 comments on commit 9a83eaf

Please sign in to comment.