Skip to content

Commit 4a231e2

Browse files
committed
chore: fix exports definition to support both ESM and CJS
1 parent ebdb1f7 commit 4a231e2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
"main": "./lib/cjs/index.js",
77
"exports": {
88
".": {
9-
"require": "./lib/cjs/index.js",
9+
"import": {
10+
"types": "./lib/esm/typings.d.ts",
1011
"default": "./lib/esm/index.mjs"
12+
},
13+
"require": {
14+
"types": "./lib/cjs/typings.d.ts",
15+
"default": "./lib/cjs/index.js"
16+
}
1117
}
1218
},
1319
"module": "./lib/esm/index.mjs",
@@ -26,10 +32,9 @@
2632
"Tong Li"
2733
],
2834
"license": "Apache-2.0",
29-
"types": "./typings.d.ts",
35+
"types": "./lib/cjs/typings.d.ts",
3036
"files": [
31-
"lib",
32-
"typings.d.ts"
37+
"lib"
3338
],
3439
"scripts": {
3540
"prebuild": "rm -rf lib",

0 commit comments

Comments
 (0)