Skip to content

Commit

Permalink
Fix CJS type import when moduleResolution is node16
Browse files Browse the repository at this point in the history
The types right now currently don't work if the user is using node16
moduleResolution in a CJS project:
https://arethetypeswrong.github.io/?p=gqtx%400.9.3
  • Loading branch information
andrew0 committed Dec 27, 2023
1 parent 4e327db commit 65e4377
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
23 changes: 17 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,26 @@
"types": "index.d.ts",
"exports": {
".": {
"import": "./index.js",
"require": "./cjs/index.cjs"
"import": {
"types": "./index.d.ts",
"default": "./index.js"
},
"require": {
"types": "./cjs/index.d.ts",
"default": "./cjs/index.cjs"
}
},
"./relay": {
"import": "./relay.js",
"require": "./cjs/relay.cjs"
"import": {
"types": "./relay.d.ts",
"default": "./relay.js"
},
"require": {
"types": "./cjs/relay.d.ts",
"default": "./cjs/relay.cjs"
}
},
"./package.json": "./package.json",
"./": "./"
"./package.json": "./package.json"
},
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/cjs",
"declaration": false
"outDir": "dist/cjs"
}
}

0 comments on commit 65e4377

Please sign in to comment.