Skip to content

Commit

Permalink
create .cts commonJs types file on build
Browse files Browse the repository at this point in the history
  • Loading branch information
etal2 authored Dec 12, 2023
1 parent 51da818 commit 93e51ee
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 93e51ee

Please sign in to comment.