-
-
Notifications
You must be signed in to change notification settings - Fork 607
Description
- Rollup Plugin Name: commonjs
- Rollup Plugin Version: 27.0.0 - 28.0.6
Expected Behavior / Situation
When using commonjs file as an entry point I want to be able to use named exports
Actual Behavior / Situation
Only default export is generated
Modification Proposal
Bring back the behavior with named exports for entry point.
Motivation
We use rollup to vendor our dependencies:
https://github.com/tutao/tutanota/blob/2218892625ed3b717ac987e531c4553989b9bf59/buildSrc/updateLibs.js
It makes much easier to review the changes and ensures that the build is less reliant on npm registry.
Unfortunately we run into an issue with undici where their changes to the entrypoint caused rollup to not generate named exports. We worked around it by normalizing the exports:
nodejs/undici#4324
but now when updating the plugin we run into the same issue.
It would make sense that we can use the library like the docs and types suggest and not import it differently just because it is vendored. When using node's native ES module interop the mapping would be different.
I would love if libraries provided native ESM entry point but right now it is not the case for some libraries that we use so we would kindly ask to reconsider the change. The alternative for us would be to maintain our own entry point/wrapper with named ESM exports which is not very appealing.