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

前端 未结 14 1757
灰色年华
灰色年华 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:21

    I'd like to add to the answer my view on these dependencies explanations

    • dependencies are used for direct usage in your codebase, things that usually end up in the production code, or chunks of code
    • devDependencies are used for the build process, tools that help you manage how the end code will end up, third party test modules, (ex. webpack stuff)

提交回复
热议问题