brigand / brigand/babel-plugin-flow-react-proptypes

Add an option for adding NODE_ENV checks for minifiers

Open
#154 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.