Member-only story

Build a React Component Library and Publish to the GitHub Package Registry

It’s always handy when working across multiple projects

Thomas Guibert
Better Programming
7 min readOct 21, 2019

Photo by Artem Sapegin on Unsplash

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.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Thomas Guibert
Thomas Guibert

Written by Thomas Guibert

Frontend engineer by day, ☀️ Aspiring Solidity engineer by night! 🌝 — Read more from me: https://medium.com/@th.guibert/membership

Responses (5)

What are your thoughts?