babel-plugin-remove-proptypes
Babel plugin for removing static declarations of React propTypes
on classes.
Input:
// MyComponent extends React.ComponentMyComponentpropTypes = someString: ReactPropTypesstringisRequired someBoolean: ReactPropTypesbool;
Output:
// Does not contain any propTypes declarations
The plugin can be used to remove PropTypes from production environments, where they have no effect.
Installation
$ npm install babel-plugin-remove-proptypes
Usage
.babelrc
Via
Via CLI
$ babel --plugins remove-proptypes script.js
Via Node API
;