Skip to content

Commit

Permalink
Specify default conditions in exports field in contentlayer package
Browse files Browse the repository at this point in the history
  • Loading branch information
jrolfs committed Mar 29, 2023
1 parent 4ca33d5 commit 9b8b622
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
10 changes: 10 additions & 0 deletions .changeset/small-readers-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'contentlayer': patch
---

Fix type resolution when using modern TypeScript module resolution

Ensure types exported from `contentlayer/core`, `contentlayer/source-files`,
and `contentlayer/client` that are imported into generated code resolve
properly when TypeScript is configured with `moduleResolution` set to
`nodenext` or `node16`.
28 changes: 7 additions & 21 deletions packages/contentlayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,13 @@
},
"exports": {
"./package.json": "./package.json",
"./source-files": {
"import": "./dist/source-files/index.js"
},
"./source-files/schema": {
"import": "./dist/source-files/schema/index.js"
},
"./source-remote-files": {
"import": "./dist/source-remote-files/index.js"
},
"./client": {
"import": "./dist/client/index.js"
},
"./utils": {
"import": "./dist/utils/index.js"
},
"./utils/node": {
"import": "./dist/utils/node/index.js"
},
"./core": {
"import": "./dist/core/index.js"
}
"./source-files": "./dist/source-files/index.js",
"./source-files/schema": "./dist/source-files/schema/index.js",
"./source-remote-files": "./dist/source-remote-files/index.js",
"./client": "./dist/client/index.js",
"./utils": "./dist/utils/index.js",
"./utils/node": "./dist/utils/node/index.js",
"./core": "./dist/core/index.js"
},
"_typesVersions": "Not needed anymore once this issue is closed https://github.com/microsoft/TypeScript/issues/33079",
"typesVersions": {
Expand Down

0 comments on commit 9b8b622

Please sign in to comment.