Skip to content

Everything goes into dependencies? #6180

Closed
@Rolandisimo

Description

@Rolandisimo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions