Skip to content

Commit 05750cc

Browse files
authored
Merge pull request #197 from authzed/re-add-support-for-cjs
Re-add support for cjs
2 parents da355e5 + c4e6014 commit 05750cc

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@
1313
"spicedb",
1414
"zanzibar"
1515
],
16-
"main": "dist/src/index.js",
16+
"main": "dist/src/index.cjs",
17+
"module": "dist/src/index.js",
1718
"types": "dist/src/index.d.ts",
19+
"exports": {
20+
"./package.json": "./package.json",
21+
".": {
22+
"types": "./dist/types/index.d.ts",
23+
"require": "./dist/cjs/index.js",
24+
"import": "./dist/esm/index.js"
25+
}
26+
},
1827
"repository": "https://github.com/authzed/authzed-node",
1928
"license": "Apache-2.0",
2029
"private": false,
@@ -24,6 +33,7 @@
2433
"buf": "buf generate && tsc-esm-fix --src src/authzedapi --ext='.js'",
2534
"lint": "./node_modules/.bin/eslint src",
2635
"build": "tsc",
36+
"postbuild": "rollup dist/src/index.js --file dist/src/index.cjs --format cjs",
2737
"prepublish": "yarn build",
2838
"build-js-client": "tsc --declaration false --outDir js-dist"
2939
},
@@ -42,6 +52,7 @@
4252
"@typescript-eslint/parser": "^8.22.0",
4353
"eslint": "^9.19.0",
4454
"grpc-tools": "^1.12.4",
55+
"rollup": "^4.34.8",
4556
"tsc-esm-fix": "^3.1.2",
4657
"typescript": "^5.7",
4758
"vitest": "^3.0.4"

0 commit comments

Comments
 (0)