Skip to content

Commit

Permalink
Merge pull request #41 from arjunyel/fix-cjs-types
Browse files Browse the repository at this point in the history
Fix CJS types
  • Loading branch information
perry-mitchell authored Aug 2, 2024
2 parents 7a34292 + e289b34 commit c8ede23
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,43 @@
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/node/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/node/index.cjs"
},
"node": {
"import": "./dist/node/index.js",
"require": "./dist/node/index.cjs"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/node/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/node/index.cjs"
}
},
"browser": {
"import": "./dist/browser/index.js",
"require": "./dist/browser/index.cjs"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/browser/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/browser/index.cjs"
}
},
"worker": {
"import": "./dist/browser/index.js",
"require": "./dist/browser/index.cjs"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/browser/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/browser/index.cjs"
}
}
}
},
Expand All @@ -35,7 +60,7 @@
"build:browser:esm": "FMT=esm ENV=browser rollup -c --name ulidx",
"build:node:cjs": "FMT=cjs ENV=node rollup -c",
"build:node:esm": "FMT=esm ENV=node rollup -c",
"build:types": "tsc -p tsconfig.dec.json --emitDeclarationOnly",
"build:types": "tsc -p tsconfig.dec.json --emitDeclarationOnly && find ./dist -name '*.d.ts' -exec sh -c 'cp {} $(dirname {})/$(basename -s .d.ts {}).d.cts' \\;",
"clean": "rimraf dist",
"format": "prettier --write \"{{source,test}/**/*.{js,ts},rollup.config.js}\"",
"prepare": "simple-git-hooks",
Expand Down

0 comments on commit c8ede23

Please sign in to comment.