A
A
Andrey Okhotnikov2019-05-06 10:10:32
React
Andrey Okhotnikov, 2019-05-06 10:10:32

How to cut prop types from production?

How to remove proptypes from production version? Airbnb configs require proptypes to be set in dependencies, is this normal?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Demian Smith, 2019-05-06
@tsepen

prop-types must be set in dependencies because it is included in executables. It doesn't matter if it's disabled in production.
Actually, the documentation also says to install prop-types in dependencies https://github.com/facebook/prop-types#installation
UPD
Let me clarify a little the difference between devDependencies and dependencies. In devDependencies, the project infrastructure is connected, for example, libraries for unit testing, builders, all kinds of webpacks.
If some library is imported in the executable files of the project (read, those files that get to the user in some processed form), then it is connected only in dependencies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question