Skip to content

doc: add current recommendation for ESM/CommonJS dual packages

This PR updates the ECMAScript Modules docs to include a recommendation from the @nodejs/modules team regarding dual CommonJS/ESM packages. Per our current roadmap, there is a good chance that the current support for dual CommonJS/ESM packages is what will be the final support when the --experimental-modules flag is dropped; the package organization method suggested in this PR would then become the recommended way for public package authors to support both CommonJS and ESM consumers of their package, should the author desire to publish both types of sources within the same package. If either of the other dual package-related proposals still under consideration end up shipping, this recommendation would still be valid.

Checklist

Merge request reports

Loading