vite
vite copied to clipboard
fix: use browser field if it is not likely UMD or CJS (fixes #9445)
Description
When the following conditions were met, browser field was not used.
- (the package does not have exports field)
- (Non-SSR build or SSR build for WebWorker)
- the package has both both browser field and module field
- browser field is not likely UMD or CJS (the file does not include
typeof exports
ortypeof module
ormodule.exports
)
fixes #9445
Additional context
What is the purpose of this pull request?
- [x] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other
Before submitting the PR, please make sure you do the following
- [x] Read the Contributing Guidelines.
- [x] Read the Pull Request Guidelines and follow the Commit Convention.
- [x] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123
). - [x] Ideally, include relevant tests that fail without this PR but pass with it.