Code Monkey home page Code Monkey logo

react-lib-scripts's Introduction

react-lib-scripts

All-in-one CLI for building React Library

oclif Version Downloads/week License

You can check react-lib-starter for the usage.

Stacks

Tech stacks used:

  • CLI
    • OCLIF
  • Bundler
    • Webpack 4
      • css-loader, iso-morphic-style-loader
      • postcss-loader (autoprefixer)
      • url-loader (all images will be base64)
      • webpack-node-externals
    • Babel

Usage

$ npm install -D react-lib-scripts
You can put the command as npm scripts.
"start": "react-lib-scripts start",
"build": "react-lib-scripts build"

Note:
- Node 8+ supported
- `NODE_ENV` environment variable is required.
Set following fields on your package.json
"main": "lib/index.js",
"files": [
  "lib",
  ...
],

Commands

react-lib-scripts build

Create library bundle

USAGE
  $ react-lib-scripts build

DESCRIPTION
  ...
  Create library bundle

See code: src/commands/build.js

react-lib-scripts help [COMMAND]

display help for react-lib-scripts

USAGE
  $ react-lib-scripts help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

react-lib-scripts start

Start lib development flow

USAGE
  $ react-lib-scripts start

DESCRIPTION
  ...
  Extra documentation goes here

See code: src/commands/start.js

Customize

  • Babel
    • You can put .babelrc in the root of your package
  • Webpack
    • Create rls.config.js
    • Copy and paste following:
      module.exports = {
        modifyWebpack: (config) => config
      }
  • PostCSS
    • You can put postcss.config.js in the root of your package

Blog

https://itnext.io/building-react-library-using-react-lib-scripts-eab6f0fd21f2

react-lib-scripts's People

Contributors

antonybudianto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.