-
Notifications
You must be signed in to change notification settings - Fork 397
add exports field to all packages #1758
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
base: main
Are you sure you want to change the base?
Conversation
no ChunkLoadError is possible then.
Effectively synonymous with nodenext.
already implied by tsconfig compilerOptions.module=node20
4ab32bb
to
8dc27f2
Compare
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 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 |
There was a problem hiding this 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
c6ffb26
to
59ce307
Compare
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 explicitnode20
setting.)https://www.typescriptlang.org/docs/handbook/modules/reference.html#the-module-compiler-option
Needs #1759 for
"exports"
support from the eslint pluginNeeds #1776 to configure webpack to work with
await import()
in a unit test.