Skip to content

Commit

Permalink
docs: recommend .d.mts & .d.cts types
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Dec 5, 2022
1 parent f2d9d40 commit e5dc3c4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ npm install --save-dev pkgroll
// "type": "module",

// Define the output files
"main": "./dist/file.cjs",
"module": "./dist/file.mjs",
"types": "./dist/file.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",

// Define output files for Node.js export maps (https://nodejs.org/api/packages.html#exports)
"exports": {
"types": "./dist/file.d.ts",
"require": "./dist/file.cjs",
"import": "./dist/file.mjs"
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
},

// bin files will be compiled to be executable with the Node.js hashbang
Expand Down

0 comments on commit e5dc3c4

Please sign in to comment.