Skip to content

aakashns/create-component-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-component-lib

Create a library of React components that can be published to npm.

Notes:

  • Uses create-react-app under 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-project

This 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 start

To transpile src/lib and create a build in the dist folder, run:

npm run build

You can then publish it to npm using:

npm publish

Note that only README.md and the dist folders are published to npm.

To learn more, see this blog post or this sample libary.

About

Create a library of React components that can be published to npm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages