Skip to content
Snippets Groups Projects
Commit 750071b5 authored by Joe Lencioni's avatar Joe Lencioni
Browse files

Remove propTypes in production

This will help reduce the bundle size impact. Note that any consumers
who are depending on any react-dates components having a `.propTypes`
property will no longer work as expected after this change.

I enabled this using wrap mode, which adds `process.env.NODE_ENV`
checks, which is a pretty standard method for React apps. I believe this
will allow this library to have propTypes in development, but for them
to be minified out in production builds.

To make this safe to enable in this repo, I enabled the
react/forbid-foreign-prop-types ESLint rule, which was written
specifically for the benefit of this plugin.

Here's a diff showing what effect this has on the esm build:

  https://gist.github.com/lencioni/1b436d365570394ccde659c829ba02c3
parent ebf83a1e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment