Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript @types/ packages in packages.json

Tags:

npm

typescript

I have a silly question regarding the @types dependencies in the package.json file:

In the following URL it is explained that the types should be installed as runtime dependency npm install --save @types/lodash TS 2.x d.ts Consumption

But to me is makes more sense to install the @types/.... packages as dev dependency npm install --save-dev @types/lodash

Any thoughts on this?

like image 825
gevik Avatar asked Feb 06 '23 02:02

gevik


1 Answers

Use --save when you are developing a module/library and wish to share the @types dependencies, otherwise use --save-dev.

some context: https://github.com/Microsoft/types-publisher/issues/81

like image 153
shusson Avatar answered Mar 02 '23 01:03

shusson