Commit 2ad58bf
fix(pkg): add default condition to exports for CJS resolvers
The exports map declared only `types` and `import` conditions,
which made CJS resolution fail with ERR_PACKAGE_PATH_NOT_EXPORTED
when a CJS caller (or a tooling path-walker like tsx's
resolveTsPaths) landed on the package. Adding a `default`
condition pointing at the same ESM entry lets Node's CJS
resolver find a match and then fail at load time with a
clearer ESM-interop error instead of a misleading
"no exports main defined".
Functionally this does not make the package dual-mode — it's
still `type: module` and the dist is ESM — but it closes the
CJS resolution gap that was breaking downstream tsx users.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9afb101 commit 2ad58bf
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
0 commit comments