Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async package should distribute both cjs and esm #1879

Open
dzearing opened this issue Nov 15, 2022 · 1 comment
Open

async package should distribute both cjs and esm #1879

dzearing opened this issue Nov 15, 2022 · 1 comment

Comments

@dzearing
Copy link

dzearing commented Nov 15, 2022

There is no real need for async-es package. It ends up complicating async usage downstream especially for projects which emit both cjs and esm. And to complicate things, async-es has a main entry which points to esm (without indicating type: 'module'), so it can't be used for cjs scenarios.

Recommended:

Update the async package.json with:

  1. main pointing to commonjs. (this is only for backwards compatibility.)
  2. module pointing to esm. (this is only for backwards compatibility.)
  3. exports map explicitly listing the valid imports and the cjs/esm/d.ts files to resolve to.
@aearly
Copy link
Collaborator

aearly commented Aug 14, 2023

The ESM strategy for this module predates the main/module convention, and exports mapping. We certainly could set it up now though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants