caolan / async

Async utilities for node and the browser
http://caolan.github.io/async/
MIT License
28.18k stars 2.41k forks source link

async package should distribute both cjs and esm #1879

Open dzearing opened 1 year ago

dzearing commented 1 year ago

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 commented 1 year ago

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