-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strategy for stripping propTypes from external packages #38
Comments
I think that convincing package authors to use the For one moment, I was worried about how we would handle I have no clue regarding package authors using
That's an interesting approach. We should support it, I have never tried it. |
I'm closing this issue. The |
This is a question.
Say I have a
.babelrc
file like this:And I'm building my project with webpack, so my JS loader looks like this:
As you can see
node_modules
are excluded, because running the transformer on npm code would be excessive / expensive. However, doing so means propType definitions from packages such as react-datepicker and react-autosuggest will remain in the final build.So my question is, what would be the smartest strategy for removing propTypes from external packages in a setup like this?
Should we be convincing package authors to add this plugin to their builds with the
wrap
mode on?P.S., I've tried just running the
babel
cli tool to strip propTypes from the compiled build, but that doesn't work (I guess, due to safeguards within your package to validate variables namedpropTypes
are actually React related).The text was updated successfully, but these errors were encountered: