I use TypeScript 2 in my project. I'd like to use some js library, but also typings for that library. I can install types with simple npm install @types/some-library
. I'm not sure if I should --save
or --save-dev
them. It seems to me that even DefinetelyTyped GitHub readme kind of mentions both versions, but never explains them. I would think that @types should be in devDependencies
, as types are needed for development and aren't used in runtime, but I saw many times @types in just dependencies
. I'm confused.
How should I decide whether @types/* goes into dependencies
or devDependencies
? Are there actually some more or less official instructions?
dependencies
anddevDependencies
in the latter case. – ValentindevDependencies
anddependencies
is irrelevant when building a bundle, it's something thatcreate-react-app
enforces as well but ultimately it's up to you to choose – Valentin