gatsby-plugin-babel-remove-prop-types

1.0.0 • Public • Published

gatsby-plugin-babel-remove-prop-types

Description

Gatsby plugin for removing unnecessary React propTypes from the production build by implementing babel-plugin-transform-react-remove-prop-types.

How to install

Install the plugin and its dependencies:

npm i gatsby-plugin-babel-remove-prop-types babel-plugin-transform-react-remove-prop-types

or

yarn add gatsby-plugin-babel-remove-prop-types babel-plugin-transform-react-remove-prop-types

Add the plugin to gatsby-config.js:

module.exports = {
  plugins: [
    // other plugins
    'gatsby-plugin-babel-remove-prop-types',
  ],
}

Example

In

const Baz = (props) => (
  <div {...props} />
);

Baz.propTypes = {
  className: PropTypes.string
};

Out

const Baz = (props) => (
  <div {...props} />
);

Package Sidebar

Install

npm i gatsby-plugin-babel-remove-prop-types

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.14 kB

Total Files

4

Last publish

Collaborators

  • elegantstack