Remove propTypes and defaultPropTypes statements from ReactJs components.
npm install rollup-plugin-strip-prop-typesRemove propTypes and defaultProps statements from ReactJs components, also removes the imported package. It expect you are using prop-types package.
``bash`
npm install --save-dev rollup-plugin-strip-prop-types
`js
// rollup.config.js
import stripPropTypes from 'rollup-plugin-strip-prop-types';
export default {
entry: 'src/index.js',
dest: 'dist/my-lib.js',
plugins: [
stripPropTypes({
// set this to false if you're not using sourcemaps –true
// defaults to ``
sourceMap: true
})
]
};
MIT