render-react-components

1.1.3 • Public • Published

render-react-components

NPM version NPM downloads Dependencies

查看中文版

render-react-components is a cli tool to recursilvly search all the react components in your project(only in src derectory) and create files to render them isolatedly.

Getting started

## Install globally or locally
$ npm i render-react-components -g

## Create files to render components
$ rrc init

## you can use the filter argument(the keyword of compoennt path) to init for part of components
$ rrc init --filter=Component1
## or simply use -f=keyword to filter
$ rrc init -f=Component1

## Local development
$ rrc dev

## Delete all the files that created by rrc init
$ rrc clean

Configuration

For configuration, you can use .rrc.js configuration file, e.g.

module.exports = {
  disableCSSModules: true,
  externals: {
    react: 'React',
    'react-dom': 'ReactDOM',
    'prop-types': 'PropTypes',
  }
};

disableCSSModules

Disable CSS Modules,we do not recommend doing this.

externals

Configure webpack's [externals] (https://webpack.js.org/configuration/externals/) property.

e.g.

// Don't pack react and react-dom
"externals": {
  "react": "window.React",
  "react-dom": "window.ReactDOM"
}

alias

Configure webpack's resolve.alias property.

extraResolveExtensions

Configure webpack's resolve.extensions property.

extraResolveModules

Configure webpack's resolve.modules property.

LICENSE

MIT

Package Sidebar

Install

npm i render-react-components

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

17.8 kB

Total Files

8

Last publish

Collaborators

  • lewis617