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

fix: use browser field if likely esm (fixes #9652) #9653

Merged
merged 4 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
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
Next Next commit
fix: revert #9459
  • Loading branch information
sapphi-red committed Aug 12, 2022
commit 502fadd78cbe8d4411767d2e5c69d1fb59761777
2 changes: 0 additions & 2 deletions packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,6 @@ export function resolvePackageEntry(
) {
// likely UMD or CJS(!!! e.g. firebase 7.x), prefer module
entryPoint = data.module
} else {
entryPoint = browserEntry
}
}
} else {
Expand Down
3 changes: 2 additions & 1 deletion playground/resolve/__tests__/resolve.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ test('browser field', async () => {
expect(await page.textContent('.browser')).toMatch('[success]')
})

test('Resolve browser field even if module field exists', async () => {
// TODO: skip because #9459 is reverted
test.skip('Resolve browser field even if module field exists', async () => {
expect(await page.textContent('.browser-module1')).toMatch('[success]')
})

Expand Down