Here at the company where we work we use git
for versioning the application. All of them use Composer to install dependencies.
Because it is the most correct approach, removing the vendor
generated by the Composer
of the repository. That is, when someone does git clone
or git pull
you must update dependencies via Composer.
But a question arose: When we are developing some dependencies are installed as require-dev
. But when we update the system in production, as we use git to do git pull
, we also need to run composer update
in production.
However, when it is in production, I do not want to include the dependency of development (require-dev).
How can I run composer install
or composer update
by ignoring the dependencies I've included in require-dev
?
Example:
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"laravelcollective/html": "5.2.*",
"guzzlehttp/guzzle" : "6.*",
"maatwebsite/excel": "~2.1.0",
"phplegends/pt-br-validator" : "2.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
Dependency of require-dev
can not be installed in production.