What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?

前端 未结 14 1761
灰色年华
灰色年华 2020-11-22 00:43

This documentation answers my question very poorly. I didn\'t understand those explanations. Can someone say in simpler words? Maybe with examples if it\'s hard to choose si

14条回答
  •  长情又很酷
    2020-11-22 01:30

    I found a simple explanation.

    Short Answer:

    dependencies "...are those that your project really needs to be able to work in production."

    devDependencies "...are those that you need during development."

    peerDependencies "if you want to create and publish your own library so that it can be used as a dependency"

    More details in this post: https://code-trotter.com/web/dependencies-vs-devdependencies-vs-peerdependencies

提交回复
热议问题