Closed
Description
Describe the bug
Vite does not correctly map the browser field
when it meet import { current } from "lib-a"
.
{
"name": "lib-entry",
"browser": {
"lib-a": "lib-b"
}
}
Vite Resolved:
import { current } from "lib-a"
Expected (Rollup resolved):
import { current } from "lib-b"
Tested versions:
- 3.2.5
- v4.0.0-beta.0
Reproduction
https://github.com/luo3house/vite-bug-browserfield
Steps to reproduce
README.md
System Info
System:
OS: Linux 5.4 Ubuntu 20.04.5 LTS (Focal Fossa)
CPU: (2) x64 Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
Memory: 2.36 GB / 3.84 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.18.1 - ~/nvm/current/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 8.19.2 - ~/nvm/current/bin/npm
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Activity