[@rollup/plugin-commonjs] Bring back named exports in commonjs entry points
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start by reviewing @rollup/plugin-commonjs handling of CommonJS entry points and the discussion around the export behavior. Use the linked updateLibs.js and undici context to understand the reported reproduction and compare generated default and named exports. Done means CommonJS entry points provide the expected named exports without breaking the documented interoperability behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- 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:
https://github.com/nodejs/undici/pull/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.
- Ngôn ngữ chính
- JavaScript
- Star
- 3.8k
- Fork
- 635
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rollup/plugins
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Support js-yaml v5 Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Tất cả issue của rollup/plugins
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100