Closed vveisard closed 1 month ago
I guess this problem has already been resolved, but just for you,
This plugin is just for people who want to use the features from dts bundle generator but in Bun. This project just kind of imports all features that we can normally use with that dts bundle generator and imports it as a Bun plugin. That is also the reason why the options in this project look pretty similar to the options in the dts bundle generator, except that we have to put the dts()
call stuff inside of the plugins
. If you still think there is a problem with this after reading the next thing, then you will have to make an issue on the official repository that this project uses.
If you look at Next.js or any other famous TypeScript frameworks, you will be able to see their tremendous works of just importing all types that the developers might have to use and exporting all imported types again from one file, like this, or this. Also, they never import any files with JPG, PNG or any other images/videos/or assets types because it is impossible to make TypeScript types for them. So, what you probably have to do is to reimport all types, reexport them in a single file without files with those extensions, set that file as the entry point, and run the script for Bun. And do not forget to add this path ./dist/index.d.ts
or whatever you set it as to the "types"
field in your package.json
so that the final file can also be exported out of the node_modules
folder.
If you have any questions or something, please comment below.
This plugin throws an error when resolving imported assets as described by the Bun documentation here:
Files
Output
Expected Behavior
I would expect this plugin to skip anything that Bun considers to be an asset.