Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(resolve): support "fallback array" in package exports field #10504

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add module condition by default
  • Loading branch information
aleclarson committed Nov 14, 2022
commit a94200f853e94c8d0498c5bfbb6eea5dfd63e67d
9 changes: 8 additions & 1 deletion packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,14 @@ function packageEntryFailure(id: string, details?: string) {
}

function getInlineConditions(conditions: string[], targetWeb: boolean) {
return targetWeb && !conditions.includes('node') ? ['browser'] : ['node']
const inlineConditions =
targetWeb && !conditions.includes('node') ? ['browser'] : ['node']

// The "module" condition is no longer recommended, but some older
// packages may still use it.
inlineConditions.push('module')

return inlineConditions
}

function resolveDeepImport(
Expand Down