Skip to content

Commit

Permalink
chore: fix exports definition to support both ESM and CJS
Browse files Browse the repository at this point in the history
  • Loading branch information
duniul committed Sep 19, 2023
1 parent ebdb1f7 commit 4a231e2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
"main": "./lib/cjs/index.js",
"exports": {
".": {
"require": "./lib/cjs/index.js",
"import": {
"types": "./lib/esm/typings.d.ts",
"default": "./lib/esm/index.mjs"
},
"require": {
"types": "./lib/cjs/typings.d.ts",
"default": "./lib/cjs/index.js"
}
}
},
"module": "./lib/esm/index.mjs",
Expand All @@ -26,10 +32,9 @@
"Tong Li"
],
"license": "Apache-2.0",
"types": "./typings.d.ts",
"types": "./lib/cjs/typings.d.ts",
"files": [
"lib",
"typings.d.ts"
"lib"
],
"scripts": {
"prebuild": "rm -rf lib",
Expand Down

0 comments on commit 4a231e2

Please sign in to comment.