Removing propTypes in production build?
See original GitHub issueWhat do you think about removing the propTypes
in the production build to reduce the bundle size using babel-plugin-transform-react-remove-prop-types
?
I’ve already prepared a fork, so if you think it is a good idea, I can submit a pull request.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:39 (24 by maintainers)
Top Results From Across the Web
Removing propTypes on Production > React with Symfony
This is a Babel plugin that can remove propTypes. Copy the library name, find your terminal, and get it!
Read more >How to remove React PropTypes from production rollup build?
You can use transform-react-remove-prop-types babel plugin with options removeImport: true . So this condition finally remove prop-types ...
Read more >gatsby-plugin-babel-remove-prop-types
Gatsby plugin for removing unnecessary React propTypes from the production build by implementing babel-plugin-transform-react-remove-prop-types.
Read more >How to use babel-plugin-transform-react-remove-prop-types
devMode && [ // Remove PropTypes from production build require('babel-plugin-transform-react-remove-prop-types').default, { removeImport: true, } ...
Read more >Optimizing React apps: Hardcore edition - DEV Community
Remove prop-types from your production bundle ... PropTypes are incredibly helpful during development, but they are of no use for your users. You ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To be honest I feel like it might have been better to actually enforce stripping
propTypes
in user code. We might make a breaking change like this in the future.We definitely don’t recommend relying on
propTypes
for any runtime behavior. It’s not at all obvious, and can lead to confusing times for anyone working on the project in the future.I think there are some valid use cases for accessing it, like