Skip to content

[tree-shaking bug] sideEffects doesn't seem to be working correctly #7635

@pd4d10

Description

@pd4d10

Describe the bug

When importing the package lowlight, some parts of the code in files listed at sideEffects are removed incorrectly:

https://github.com/wooorm/lowlight/blob/0803fc3416cbdf59f204da243313e3315eb34617/lib/common.js#L1-L36

Reproduce steps

  1. Open the reproduction link below
  2. run npm run build
  3. Check if the JS output has these highlight.js languages code bundled in

Reproduction

https://stackblitz.com/edit/vitejs-vite-zyomf8?file=main.js

System Info

It has been reproduced at Stackblitz. So ignore this part.

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: upstreamBug in a dependency of ViteinconsistencyInconsistency between dev & buildp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions