Skip to content

ChenX1993/react-library-template

Repository files navigation

Simple React Library Template

File Structure

NPM Publish

Component Dev

  • Install dependencies:

    npm i
    npm start
  • Package components

    npm run build

Local Test

  • 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

Publish to npm

  • 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

npm install

  • 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';

Reference

https://juejin.im/post/5d6760b3e51d453b8b5fa60b#heading-5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published