Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/goto-bus-stop/remove-react-proptypes

Remove React propTypes.
https://github.com/goto-bus-stop/remove-react-proptypes

browserify cli proptypes react webpack-loader

Last synced: 27 days ago
JSON representation

Remove React propTypes.

Awesome Lists containing this project

README

        

# remove-react-proptypes

Remove React PropTypes. Removes all occurrences of `.propTypes = `.

## Installation

```bash
npm install --save-dev remove-react-proptypes
```

Or install the CLI globally:

```bash
npm install --global remove-react-proptypes
```

## Usage

CLI:

```bash
remove-react-proptypes input.js > output.js
# or pipe to stdin:
cat input.js | remove-react-proptypes | uglifyjs -o output.js
```

Node:

```js
const removeReactPropTypes = require('remove-react-proptypes')
const outputString = removeReactPropTypes(inputString)
```

Node.js streams:

```js
const removeReactPropTypes = require('remove-react-proptypes/stream')
fs.createReadStream('input.js')
.pipe(removeReactPropTypes())
.pipe(fs.writeReadStream('output.js'))
```

Browserify:

```js
browserify -g remove-react-proptypes/stream -e input.js > output.js
```

Webpack 2:

```js
module.exports = {
module: {
rules: [
// You may want to put this in a separate `modules` rule, so it's applied
// to dependencies as well:
{
test: /\.js$/,
use: 'remove-react-proptypes'
},
// And use other loaders as normal:
{
test: /\.js$/,
exclude: /node_modules/,
use: [
'babel-loader'
]
}
]
}
}
```

## License

[MIT](./LICENSE)