What is the difference between --save and --save-dev?

后端 未结 13 867
旧巷少年郎
旧巷少年郎 2020-11-28 00:02

What is the difference between:

npm install [package_name]

and:

npm install [package_name] --save

and:

13条回答
  •  爱一瞬间的悲伤
    2020-11-28 00:33

    A perfect example of this is:

    $ npm install typescript --save-dev
    

    In this case, you'd want to have Typescript (a javascript-parseable coding language) available for development, but once the app is deployed, it is no longer necessary, as all of the code has been transpiled to javascript. As such, it would make no sense to include it in the published app. Indeed, it would only take up space and increase download times.

提交回复
热议问题