[@rollup/plugin-commonjs] Bring back named exports in commonjs entry points
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript
- Ambito
- build-system
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- 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.
- Lingua principale
- JavaScript
- Stelle
- 3.8k
- Fork
- 635
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rollup/plugins
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Support js-yaml v5 Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di rollup/plugins
Issue simili
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#30750 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Mend: dependency security vulnerability untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100