-
Notifications
You must be signed in to change notification settings - Fork 710
Closed as not planned
Description
When a package provides conditional exports (.mjs for ESM / .(c)js for CJS), and consumers import the same subpath via both ESM import() and CJS require(), rolldown seems to bundle both variants as separate module graph nodes instead of deduplicating them.
This causes:
- Duplicated module code in the output (increased bundle size)
- Broken module identity (two separate instances of the same logical module)
- In complex chunk graphs (e.g., tsdown with multiple entries), broken
__esmMininit wrappers → TypeError:init_xxxis not a function
I found it while working on oxc-project/oxc#19807.
The reproduction steps and more details are here.
👉🏻 https://github.com/leaysgur/rolldown-esm-cjs-dedupe-repro
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels