Use babel-plugin-transform-react-remove-prop-types for build:node task#463
Merged
gpbl merged 1 commit intogpbl:masterfrom Jul 19, 2017
Merged
Use babel-plugin-transform-react-remove-prop-types for build:node task#463gpbl merged 1 commit intogpbl:masterfrom
gpbl merged 1 commit intogpbl:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #463 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 15 15
Lines 527 527
Branches 109 109
=====================================
Hits 527 527Continue to review full report at Codecov.
|
Owner
|
thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature:
Fixes #462
This will wrap all assignments to the propTypes property of a React component class in a
process.env.NODE_ENV !== "production", which will allow npm module consumers to remove prop types for their production build. This will allow for smaller deployables for consumers.Known Issue:
This will require users to inject the value for
process.env.NODE_ENV. Consumers can do this via webpack's Environment Plugin or rollup's Replace Plugin.Changes:
Add
transform-react-remove-prop-typesto the.babelrcfile with the mode set to "wrap". Output will end up looking like this:cc: @gpbl