Photo by Jess Bailey on Unsplash Publishing a TypeScript React component library to NPM Key takeaways: compile to a dist directory copy package.json and README.md files to the dist directory publish the dist directory If you get stuck or lost at a...

Markdown supported · ⌘↵ to post
Hi,
Thanks for the tutorial. However, I am facing some issues with Nextjs v12 when importing the component. It is saying that the export token does not exists... I solved it by changing the export to something like:
export * from './counter';
Good one Rupert! One question, if package that you are publishing is part of a workspace, would publishing from dist work? Most likely you need to build the package and point main file to dist/index.js in order to use it elsewhere in the workspace, how would you deal with that?
Oleksandr Klymenko
FE dev
Thanks for the article, what should we add if we need to add styling for our component? and our styles should be applied when we import our package.