Skip to content

Commit

Permalink
fix(vite): conditional exports can't be active when key is browser vi…
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Sep 3, 2024
1 parent 0ca53cf commit 074609b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,9 @@ function resolveExportsOrImports(

const fn = type === 'imports' ? imports : exports
const result = fn(pkg, key, {
browser: targetWeb && !additionalConditions.has('node'),
browser:
additionalConditions.has('browser') ||
(targetWeb && !additionalConditions.has('node')),
require: options.isRequire && !additionalConditions.has('import'),
conditions,
})
Expand Down

0 comments on commit 074609b

Please sign in to comment.