I am trying to create my first npm module, here is the source code:
https://github.com/balazsorban44/use-form
I would like to use semantic-release
and write my code in .js
files, but I also include some type declaration files for a better experience in IDEs like VSCode. (Note, I am learning TypeScript as well)
I found a way to bundle my code and even publish it to npm with semantic-release, but when I try to import that module into a React project, I don't get any suggestions from the IDE, probably because I missed a (or a few) step(s)? How can I include the .d.ts
files, so my IDE will pick up the type declarations?
I figured out, thanks to the help I got on Twitter!
In package.json
I had to add my typings folder to the files to be published on NPM:
Apart from that, these lines may play an important role also:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.