Skip to content

ElegantStack/gatsby-plugin-babel-remove-prop-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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} />
);

About

Gatsby plugin for removing unnecessary React propTypes from the production build.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors