Skip to content

Commit

Permalink
🏷️ Better declare ESM's types (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Sep 4, 2023
1 parent a0a0fd4 commit 9aca792
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
"type": "commonjs",
"main": "lib/pure-rand.js",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./lib/types/pure-rand.d.ts",
"require": "./lib/pure-rand.js",
"import": "./lib/esm/pure-rand.js",
"default": "./lib/esm/pure-rand.js"
"require": {
"types": "./lib/types/pure-rand.d.ts",
"default": "./lib/pure-rand.js"
},
"import": {
"types": "./lib/esm/types/pure-rand.d.ts",
"default": "./lib/esm/pure-rand.js"
}
}
},
"module": "lib/esm/pure-rand.js",
Expand All @@ -23,7 +28,7 @@
"format:check": "prettier --list-different .",
"format": "prettier --write .",
"build": "tsc && tsc -p ./tsconfig.declaration.json",
"build:esm": "tsc --module es2015 --outDir lib/esm --moduleResolution node && cp package.esm-template.json lib/esm/package.json",
"build:esm": "tsc --module es2015 --outDir lib/esm --moduleResolution node && tsc -p ./tsconfig.declaration.json --outDir lib/esm/types && cp package.esm-template.json lib/esm/package.json",
"build:prod": "yarn build && yarn build:esm && node postbuild/main.cjs",
"build:prod-ci": "cross-env EXPECT_GITHUB_SHA=true yarn build:prod",
"test": "jest --config jest.config.js --coverage",
Expand Down

0 comments on commit 9aca792

Please sign in to comment.