Skip to content
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

Enable ESM instead of CommonJS-only #23029

Open
JPeer264 opened this issue Mar 24, 2020 · 2 comments
Open

Enable ESM instead of CommonJS-only #23029

JPeer264 opened this issue Mar 24, 2020 · 2 comments

Comments

@JPeer264
Copy link

@JPeer264 JPeer264 commented Mar 24, 2020

What would you like to be added:
rollup should export ESM and CommonJS as final build. Currently we are using some @grafana/ui components but tree-shaking is not possible with the CommonJS produced code.

So that is why rollup should also produce ESM modules.

Why is this needed:

  1. rollup should also include ESM modules
  2. Tell the package.json where the ESM produced code is stored: "module": "./grafana-ui.esm.js",
@peterholmberg peterholmberg added this to Inbox in Platform Squad via automation Mar 24, 2020
@torkelo

This comment has been minimized.

Copy link
Member

@torkelo torkelo commented Mar 24, 2020

tree shaking is not really relevant here as the @grafana/* packages are externalized in the plugin build (they are loaded from the Grafana instance the plugin is running in)

@JPeer264

This comment has been minimized.

Copy link
Author

@JPeer264 JPeer264 commented Mar 25, 2020

Exactly that is what I thought and totally understand this decision. Would you still accept PRs regarding this to support both?

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.