brigand / brigand/babel-plugin-flow-react-proptypes
Add an option for adding NODE_ENV checks for minifiers
- Dominant language
- JavaScript
- Stars
- 427
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Consumers of a library should be able to access the library's proptypes in dev builds, but then be able to seamlessly strip them out for production.
See conversation on https://github.com/brigand/babel-plugin-flow-react-proptypes/issues/70#issuecomment-278551711.
TODO:
- [x] add deadCode config option (see readme)
- [x] dce for the propTypes object
- [x] dce for exported types (export type Foo =)
- [ ] dce for imported types (import type {Foo} from './Foo)
- [ ] dce for the actual 'propTypes' property, both with the default assignment at end of file, and the the useStatic option (currently propTypes=null after minify)
Contributor guide
Assessment
This issue has not been assessed yet.