Skip to content

Mention dual ESM/CJS declarations in extensionless readme and in the table #1

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

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add dual ESM/CJS type declarations row to the table
  • Loading branch information
fictitious committed Sep 21, 2022
commit 108e20b15a9fbbc2e22bb1ebbbbddea53c98507c
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ Each of the two TypeScript projects successfully type checks with `npm run build
Note that the [`types-versions-wildcard`](./examples/node_modules/types-versions-wildcards) fallback strategy is only fallback for TypeScript, so it does not help users who are on Node 11 or other runtimes/bundlers that lack `exports` support. It is included because it is the only method that offers an analog to `*` wildcards in subpath `exports`.

| | [`extensionless`](./examples/node_modules/extensionless) | [`package-json-redirects`](./examples/node_modules/package-json-redirects) | [`types-versions-wildcards`](./examples/node_modules/types-versions-wildcards) |
|----------------------------------------|------------------|-----------------|------------------|
| TypeScript `--moduleResolution node16` | ✅ via `exports` | ✅ via `exports` | ✅ via `exports` |
| TypeScript `--moduleResolution node` | ✅ via fallback | ✅ via fallback | ✅ via fallback |
| Node 12+ | ✅ via `exports` | ✅ via `exports` | ✅ via `exports` |
| Node 11 | ✅ via fallback | ✅ via fallback | ❌ |
| Most bundlers | ✅ via `exports` | ✅ via `exports` | ✅ via `exports` |
| Parcel, Browserify | ✅ via fallback | ✅ via fallback | ❌ |
|------------------------------------------------------|-----------------------|------------------|------------------|
| TypeScript `--moduleResolution node16` | ✅ via `exports` | ✅ via `exports` | ✅ via `exports` |
| TypeScript `--moduleResolution node` | ✅ via fallback | ✅ via fallback | ✅ via fallback |
| Supports dual ESM/CJS type declarations for `node16` | ✅ via sibling lookup | no | no |
| Node 12+ | ✅ via `exports` | ✅ via `exports` | ✅ via `exports` |
| Node 11 | ✅ via fallback | ✅ via fallback | ❌ |
| Most bundlers | ✅ via `exports` | ✅ via `exports` | ✅ via `exports` |
| Parcel, Browserify | ✅ via fallback | ✅ via fallback | ❌ |