Description
Using Typescript for quite a while now I was surprised that create-react-app
guide for adding types says that you have to execute the following command:
yarn add typescript @types/node @types/react @types/react-dom @types/jest
.
In other words add dependencies that are being used only in development to the dependencies that are supposed to end up in the final build files. (At least that's how I understood the difference between dev and non-dev dependencies)
From docs.npmjs.com about dependencies:
Please do not put test harnesses or transpilers in your dependencies object. See devDependencies, below.
My question is:
Why typescript, node-sass, types and such (seems that all install examples on the website are installing stuff to the dependencies
) are not installed in devDependencies
i.e. --dev
?
P.S. I did read this discussion which seemed somewhat related, but still had this question in mind and wanted someone to make this clear once and for all.