Skip to content

Vite does not correctly map browser field #11208

Closed
@luo3house

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions