oliviertassinari / babel-plugin-transform-react-remove-prop-types

Remove unnecessary React propTypes from the production build. :balloon:
MIT License
897 stars 61 forks source link

.babelrc "env" ignore in babel v6 #149

Closed gknapp closed 6 years ago

gknapp commented 6 years ago

How can you run this plugin for production builds only? I can only seem to run it when it's in my root plugins section of .babelrc.

As far as I can tell, babel v6 has broken the documented "env": {} option and was only fixed in v7.

See: babel/babel#4539 and babel/babel#5276

oliviertassinari commented 6 years ago

@gknapp You can use the wrap option as a workaround. But I would encourage you to find a solution on Babel side. I'm 99.9% confident that the "env": {} option still work. It would have been such a major change.

oliviertassinari commented 6 years ago

@gknapp You can use the wrap option as a workaround. But I would encourage you to find a solution on Babel side. I'm 99.99% confident that the "env": {} option still work. It would have been such a major change.