Skip to content
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

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 8 additions & 7 deletions README.md
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 | ❌ |
7 changes: 7 additions & 0 deletions examples/node_modules/extensionless/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.