babel-plugin-react-prop-types-remover
v1.0.1
Published
Babel plugin for removing React's propTypes declarations in production builds.
Downloads
6
Readme
babel-plugin-react-prop-types-remover
Babel plugin for removing React's propTypes declarations in production builds.
Installation
npm install babel-plugin-react-prop-types-remover --save-dev
Usage
CLI
$ browserify script.js -o bundle.js -t [ babelify --plugins [ babel-plugin-react-prop-types-remover ] ]
Node
var fs = require('fs');
var browserify = require('browserify');
browserify('./script.js')
.transform('babelify', { plugins: ['babel-plugin-react-prop-types-remover'] })
.bundle()
.pipe(fs.createWriteStream('bundle.js'));
Example
script.js
:
class Foo {
static get baz() {}
static get propTypes() {}
get myFo() {}
bar() {}
}
will be transformed to bundle.js
:
class Foo {
static get baz() {}
get myFo() {}
bar() {}
}