Skip to content

Commit fdf7660

Browse files
authored
Fix types in CJS environments (#220)
1 parent 948263a commit fdf7660

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
"exports": {
2020
"./package.json": "./package.json",
2121
".": {
22-
"types": "./dist/src/index.d.ts",
22+
"types": {
23+
"import": "./dist/src/index.d.ts",
24+
"require": "./dist/src/index.d.cts",
25+
"default": "./dist/src/index.d.ts"
26+
},
2327
"require": "./dist/src/index.cjs",
2428
"import": "./dist/src/index.js"
2529
}
@@ -33,7 +37,7 @@
3337
"buf": "buf generate && tsc-esm-fix --src src/authzedapi --ext='.js'",
3438
"lint": "./node_modules/.bin/eslint src",
3539
"build": "tsc",
36-
"postbuild": "rollup dist/src/index.js --file dist/src/index.cjs --format cjs",
40+
"postbuild": "rollup dist/src/index.js --file dist/src/index.cjs --format cjs && cp dist/src/index.d.ts dist/src/index.d.cts",
3741
"prepublish": "yarn build",
3842
"build-js-client": "tsc --declaration false --outDir js-dist"
3943
},

0 commit comments

Comments
 (0)