Skip to content

Conversation

dynst
Copy link
Contributor

@dynst dynst commented Jul 30, 2025

The "main" field has been replaceable by "exports" since Node 12.

https://nodejs.org/api/packages.html#community-conditions-definitions

Node 20 is nodenext as of TypeScript 5.8. (TypeScript 5.9 will add an explicit node20 setting.)

https://www.typescriptlang.org/docs/handbook/modules/reference.html#the-module-compiler-option

Needs #1759 for "exports" support from the eslint plugin

Needs #1776 to configure webpack to work with await import() in a unit test.

no ChunkLoadError is possible then.
@dynst dynst force-pushed the exports-field branch 2 times, most recently from 4ab32bb to 8dc27f2 Compare August 7, 2025 17:59
@dynst
Copy link
Contributor Author

dynst commented Aug 13, 2025

This seems good for 0.36, in practical terms it would stop accidentally exposing internal files as part of the importable API - only the file explicitly listed in "exports" will be importable.

Also enables code in a package to import from itself without directly pointing at index.ts or another file.

https://nodejs.org/api/packages.html#self-referencing-a-package-using-its-name

@webmaster128 webmaster128 added this to the 0.37 milestone Aug 14, 2025
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exports changes looks good. Could you rebase this to latest main? We only need the last commit, right? All the tsconfig stuff is a different topic and also we have those changes on main already

@dynst dynst force-pushed the exports-field branch 2 times, most recently from c6ffb26 to 59ce307 Compare August 16, 2025 00:43
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.

2 participants