Closed slevithan closed 2 months ago
@nzakas's comment/suggestion about bundling the JS and then running tsc on the bundle is probably the way to go, but alas, regex
currently uses esbuild for bundling, and esbuild doesn't (and won't) include an option to preserve JSDoc comments or all comments. So this would require switching to Rollup or another bundler, which I'm open to doing.
My take – you can afford to wait:
.d.ts
files are only used during development.Based on @rauschma comment, I'ma go ahead and close this with no changes planned for now.
I've noticed that the plasmic library is currently relying on importing regex
's types/pattern.d.ts
, so any changes to the current approach of generating multiple .d.ts
files would need to be treated as a breaking change.
6 added TypeScript
.d.ts
files. However, multiple.d.ts
files are currently generated. It would be nicer to generate a single fileindex.d.ts
. PRs (or any other help) would be welcome from someone who wants to take on this issue. I'd be fine with switching from esbuild to another bundler if that helps keep things simple.@rauschma asked about how to do this in this Mastodon thread. Saving the post and replies below for posterity.
Note: The Rollup plugin is probably referring to rollup-plugin-dts.