You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: There should be clear guidance how to configure pure ESM packages that work in consuming projects with "moduleResolution": "nodenext". I ran into a confusing issue with the antlr4 package. It wasn't immediately obvious to me what fix to suggest. As pure ESM becomes more widespread in the ecosystem there will be a lot of dev confusion like this with misconfigured packages.
Recommended Fix: I think the docs should recommend using "moduleResolution": "nodenext" in the build config for pure ESM packages so that they catch any issues consumers using that resolution would encounter. Or at least in the build config used to check the type defs for node. Are there any problems with this I'm not aware of?
In addition the publishing page should have an example of using export maps with types.
The text was updated successfully, but these errors were encountered:
jedwards1211
changed the title
The docs don't provide enough guidance for publishing pure ESM packages
The docs should provide better guidance for publishing pure ESM packages
Apr 3, 2023
Hello! As per #2804, we are automatically closing all open issues. Please see #2804 for a description of what issues and PRs can be accepted going forward.
Page URL: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html, https://www.typescriptlang.org/docs/handbook/esm-node.html
Issue: There should be clear guidance how to configure pure ESM packages that work in consuming projects with
"moduleResolution": "nodenext"
. I ran into a confusing issue with theantlr4
package. It wasn't immediately obvious to me what fix to suggest. As pure ESM becomes more widespread in the ecosystem there will be a lot of dev confusion like this with misconfigured packages.Recommended Fix: I think the docs should recommend using
"moduleResolution": "nodenext"
in the build config for pure ESM packages so that they catch any issues consumers using that resolution would encounter. Or at least in the build config used to check the type defs for node. Are there any problems with this I'm not aware of?In addition the
publishing
page should have an example of using export maps withtypes
.The text was updated successfully, but these errors were encountered: