Skip to content

Commit

Permalink
fix: improve CommonJS TypeScript support
Browse files Browse the repository at this point in the history
Improve CommonJS support
  • Loading branch information
psibean authored Dec 13, 2023
2 parents 51da818 + 93e51ee commit 6cecbd4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"exports": {
".": {
"require": {
"types": "./lib/index.d.ts",
"types": "./lib/index.d.cts",
"default": "./lib/cjs/index.cjs"
},
"import": {
Expand All @@ -20,15 +20,16 @@
"files": [
"lib/esm/index.js",
"lib/cjs/index.cjs",
"lib/index.d.ts"
"lib/index.d.ts",
"lib/index.d.cts"
],
"scripts": {
"test": "mocha --recursive ./src/tests/*.test.ts",
"clean": "rm -rf ./lib",
"lint": "npx eslint .",
"prettify": "npx prettier --write .",
"build:types": "tsc --declaration --outDir ./lib --emitDeclarationOnly",
"build:cjs": "tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs",
"build:cjs": "tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs && cp ./lib/index.d.ts ./lib/index.d.cts",
"build:esm": "tsc -p tsconfig.json",
"build": "npm run build:types && npm run build:esm && npm run build:cjs",
"build:clean": "npm run clean && npm run build",
Expand Down

0 comments on commit 6cecbd4

Please sign in to comment.