Skip to content

Commit

Permalink
feat: add experimental dts rollup using @microsoft/api-extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue committed Aug 31, 2023
1 parent 9b81362 commit 3943d73
Show file tree
Hide file tree
Showing 13 changed files with 1,230 additions and 60 deletions.
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ If you have multiple entry files, each entry will get a corresponding `.d.ts` fi

Note that `--dts` does not resolve external (aka in `node_modules`) types used in the `.d.ts` file, if that's somehow a requirement, try the experimental `--dts-resolve` flag instead.

Since tsup version 7.3.0, you can also use `--experimental-dts` flag to generate declaration files. This flag use [@microsoft/api-extractor](https://www.npmjs.com/package/@microsoft/api-extractor) to generate declaration files, which is more reliable than the previous `--dts` flag. It's still experimental and we are looking for feedbacks.

#### Emit declaration file only

The `--dts-only` flag is the equivalent of the `emitDeclarationOnly` option in `tsc`. Using this flag will only emit the declaration file, without the JavaScript files.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"build-fast": "npm run build -- --no-dts"
},
"dependencies": {
"@microsoft/api-extractor": "^7.36.4",
"bundle-require": "^4.0.0",
"cac": "^6.7.12",
"chokidar": "^3.5.1",
Expand Down

0 comments on commit 3943d73

Please sign in to comment.