Skip to content

[release-12.1.1] Fix: Prevent Rollup from treeshaking NPM packages #108570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release-12.1.1
Choose a base branch
from

Conversation

grafana-delivery-bot[bot]
Copy link
Contributor

Backport 15d9df9 from #108567


What is this feature?

This PR fixes an issue where (during bundling the NPM packages in this repo) rollup is treeshaking any properties that aren't used in the libraries source code.

Why do we need this feature?

Treeshaking the library at build seems rather prone to error as we want the consumer to treeshake it at application build time. (Internal slack thread)

before
image

after
image

Who is this feature for?

Plugin developers

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

fix(packages): prevent rollup from treeshaking libraries

(cherry picked from commit 15d9df9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant