Member-only story
Build a React Component Library and Publish to the GitHub Package Registry
It’s always handy when working across multiple projects

Do you have that one set components that are nicely designed, so perfect, that you copy them from one project to another? Do you dream about using npm install
to put it in your next app, instead of having to copy/paste it? If so, you’re in the right place!
Today, you’ll learn how to build your own React Component Library and publish it to the brand new GitHub Package Registry!
You will be using these following cool things:
- TypeScript: No need to introduce this, I hope!
- Rollup.js: A Javascript module bundler to compile our code,
- Create-react-app: The easy-way to create a simple React App which we are going to use as a playground to test your component(s),
- Npm-run-all: A CLI tool to run multiple npm-scripts in parallel,
- GitHub Package Registry: GitHub’s package management service, which makes it easy to publish public or private packages next to your source code.
As usual with my pieces, all the code can be found on my GitHub.