Create a library of React components that can be published to npm.
create-react-appunder the hood.
- Inspired from this blog post.
- Currenlty tested only on Linux and Mac.
- It's really just a shell script. Contributions welcome!
To create a new project, run the command:
npx create-component-lib my-project
This sets up the project inside
Place everything you want to publish to npm inside
src/lib (but inside
src/), you can create example web pages to test or demonstrate the usage of your components.
To start the development server (with entry point
src/lib and create a build in the
dist folder, run:
npm run build
You can then publish it to npm using:
Note that only
README.md and the
dist folders are published to npm.