-
Install dependencies:
npm i npm start
-
Package components
npm run build
-
Root dir:
npm link cd src/example npm link react-simple-library-template
-
Edit example/src/app.js file(replace the one you want to test):
// import { DemoButton1 } from '../../src' import { DemoButton1 } from 'react-simple-library-template'; import 'react-simple-library-template/lib/main.min.css'; // css
-
Root dir:
npm start
-
Check npm config:
npm config list
-
Change origin:
npm config set registry http://registry.npmjs.org
-
publish to npm:
npm run pub # same above npm build npm publish
-
unpublish:
npm unpublish react-simple-library-template --force # replace with you npm lib name
-
Download:
npm i react-simple-library-template
-
Use:
# ES6 import import { DemoButton1 } from 'react-simple-library-template'; # if use css. import 'react-simple-library-template/lib/main.min.css';