Add type exports support in package #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "amin/add-type-exports"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the proper value in
package.exportsfor TypeScript to pick the type declarations.What concrete problem does this solve? As far as I know, TS will already pick up the current declaration files.
@marijnh if you set
bundlerornodenextas your module resolution in TS config, it won't pick up thetypesproperty of the package.json, it will look for counterpart ofexports.Read more here.
Are you entirely sure that the current setup doesn't work? Because I'm using this system (make sure the declaration's filename matches the exported dist file) across all my packages, and it actually solves this problem, as far as I'm aware.
I'm testing, and it seems it's working now. I'm not entire sure how it was failing but it was initially failing for me.
Thans for looking into it. 🙏
Apologies, I double checked, and it seems the issue was on v1.0.0. The latest has the correct path to types.
Pull request closed