Create an NPM Environment
First, you need to create an NPM environment for your library so that NPM knows what dependencies and scripts are associated with the library. Run:
Follow the instructions and it’ll attempt to create a proper package.json for your project.
Useful Dev Tools
Linter: Check for coding errors — saves a trip to the browser (Airbnb’s linter is useful) Webpack: For building and compiling JSX, ES6, etc. It will create static site with the option to serve it up locally on the localhost.
Use GitHub Repo as the Public NPM Package
File structure of GitHub repo if you want to use it as a public package: library-name/ demo/ dist/ src/