bloody-strip-proptypes
v1.0.0
Published
babel loader to remove propTypes in production
Readme
strip-proptypes
install
$ npm install bloody-strip-proptypeswhat it does
in production, react doesn't check propTypes. this plugin removes the
static propTypes declarations in ES6 classes.
class extends Component {
static contextTypes = {
router: PropTypes.func,
}
static propTypes = {
content: PropTypes.string,
}
render() {
return (
<div />
)
}
}will be transformed into
class extends Component {
static contextTypes = {
router: PropTypes.func,
}
render() {
return (
<div />
)
}
}usage
$ babel --plugins bloody-strip-proptypes source.js