-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for configure wrap condition #191
Comments
I think this can be accomplished by using BABEL_ENV
…On Sat, Apr 4, 2020, 4:25 AM Super Snager ***@***.***> wrote:
Sometimes you may want to remove propTypes for production build, but
sometimes not.
For example when your library is imported in storybook, you want not to
remove propTypes, because storybook reads it to show in docs page.
I think, that plugin should support this case - condition string should be
configurable.
In storybook scenario wrap condition might look like this:
if (process.env.NODE_ENV !== "production" || process.env.NOT_REMOVE_PROP_TYPES) {
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#191>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABPXTX77PUSBIW6TOAO72DRK34HPANCNFSM4L5YWFDQ>
.
|
@lencioni How? |
I think you could define a storybook env in your Babel config that doesn't
include this plugin, and then start storybook with the BABEL_ENV env var
set to match.
…On Sat, Apr 4, 2020, 10:29 AM Super Snager ***@***.***> wrote:
@lencioni <https://github.com/lencioni> How?
Can you explain it further?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#191 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABPXTRZ36AKNEJQIEDKURDRK5G33ANCNFSM4L5YWFDQ>
.
|
@lencioni It is not possible to do it in this way.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes you may want to remove propTypes for production build, but sometimes not.
For example when your library is imported in storybook, you want not to remove propTypes, because storybook reads it to show in docs page.
I think, that plugin should support this case - condition string should be configurable.
In storybook scenario wrap condition might look like this:
The text was updated successfully, but these errors were encountered: