Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/goto-bus-stop/remove-react-proptypes
- Owner: goto-bus-stop
- License: mit
- Created: 2017-02-26T15:58:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-02-26T16:25:46.000Z (over 7 years ago)
- Last Synced: 2024-10-05T16:26:25.499Z (about 1 month ago)
- Topics: browserify, cli, proptypes, react, webpack-loader
- Language: JavaScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
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)