Skip to content

Change to a CJS fallback instead of ESM fallback - #3

Closed
darcyrush wants to merge 1 commit into
P0lip:mainfrom
darcyrush:cjs-fallback
Closed

Change to a CJS fallback instead of ESM fallback#3
darcyrush wants to merge 1 commit into
P0lip:mainfrom
darcyrush:cjs-fallback

Conversation

@darcyrush

Copy link
Copy Markdown

So the dual package setup within this project currently has a fallback for ESM projects which are using legacy node module resolution settings.

"module": "./dist/esm/index.js",

However, I believe such projects are incredibly rare given that good node ESM support has been something very recent and the legacy node module resolution issue was resolved many years before that point. As such, most ESM projects are likely using modern configuration settings, or can fairly easily migrate to modern configuration settings.

More commonly it is old CJS projects which are using legacy node module resolution settings and are in no position to update.

Still, this is technically a breaking change, so this is your call, but I believe the percentage of CJS users impacted by not having a CJS fallback is far higher than ESM.

@darcyrush

Copy link
Copy Markdown
Author

Actually now that Node20 is Eol, the correct packaging method is much more simple and the project only needs to be exported in one format - either CJS or ESM

@darcyrush

Copy link
Copy Markdown
Author

Superseded by #7

@darcyrush darcyrush closed this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant