What is the difference between require and require-dev sections in composer.json?

前端 未结 6 503
北海茫月
北海茫月 2020-11-28 20:38

I\'m beginning using composer, I know so little about it and have a little experience with web application development.

I just walk through Nettuts+ Tutorial, so I h

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 21:04

    Note the require-dev (root-only) !

    which means that the require-dev section is only valid when your package is the root of the entire project. I.e. if you run composer update from your package folder.

    If you develop a plugin for some main project, that has it's own composer.json, then your require-dev section will be completely ignored! If you need your developement dependencies, you have to move your require-dev to composer.json in main project.

提交回复
热议问题