Skip to content
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

Open
supersnager opened this issue Apr 4, 2020 · 4 comments
Open

Support for configure wrap condition #191

supersnager opened this issue Apr 4, 2020 · 4 comments

Comments

@supersnager
Copy link

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) {
@lencioni
Copy link
Collaborator

lencioni commented Apr 4, 2020 via email

@supersnager
Copy link
Author

@lencioni How?
Can you explain it further?

@lencioni
Copy link
Collaborator

lencioni commented Apr 4, 2020 via email

@supersnager
Copy link
Author

@lencioni It is not possible to do it in this way.
Library is dependency in storybook, is already built and has wrapped prop types:

if (process.env.NODE_ENV !== "production" ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants