Hello, I want to create a new component package for react, which I might publish on npm later. I haven't done this before,so can you tell me the steps needed to setup a basic template for a new package, something like what create-react-app does, but for packages. Also most packages on npm have typscript types along with them, so would that require some extra setup steps? Please comment if you have any idea.
Thank you!
Top comments (4)
You should take a look at tsdx.io/
Sets up everything you need to make npm packages with TS and Jest. Also fixes all of the dist setup for CJS and ESM. I've used it a few times and its brilliant and super east.
Hey, thanks for the reply!
This seems very cool, and very useful, Thanks for the info, I'll sure try it out π π
There is CLI for creating reusable react libraries: github.com/transitive-bullshit/cre...
Hey, thanks for the reply! π π
I had actually checked this out before, but I didn't find any explanation for how to use it with TS, although it is said in Readme that it has optional TS support. Do you have any idea on how to make it work with TS?