Skip to content

Rollup doesn't respect sideEffects #4470

@pd4d10

Description

@pd4d10

Rollup Version

2.70.1

Operating System (or Browser)

macOS

Node Version (if applicable)

16

Link To Reproduction

https://stackblitz.com/edit/node-lr98tg

Expected Behaviour

As lib/common.js are listed in the sideEffects field, these lines should not be removed:

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

Actual Behaviour

They are removed incorrectly

Additional Information

Reproduce steps

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

Related issues:
vitejs/vite#7635
rollup/plugins#1159

Metadata

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