0.1.6 • Published 7 years ago
create-component-lib v0.1.6
create-component-lib
Create a library of React components that can be published to npm.
Notes:
- Uses
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!
Usage
To create a new project, run the command:
npx create-component-lib my-projectThis sets up the project inside my-project.
Place everything you want to publish to npm inside src/lib. Outside 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/index.js), run
npm startTo transpile src/lib and create a build in the dist folder, run:
npm run buildYou can then publish it to npm using:
npm publishNote that only README.md and the dist folders are published to npm.
To learn more, see this blog post or this sample libary.