Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[@rollup/plugin-commonjs] Bring back named exports in commonjs entry points

Aperta
#1,885 11 commenti 2 reazioni 0 assegnatari Vedi su GitHub

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rollup/plugins

Tutte le issue di rollup/plugins

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.