I'm new in composer development. I just start to work with composer in my current project. And I think my question is already asked before or I'm noob about composer :D
There are many test files and directories in vendor of each dependency. I just want to remove those tests before upload it to server.
Is there any command to remove those tests OR I need to remove it manually OR what...? :'(
Not directly, but if the package maintainers followed some best practises it is possible.
Use the --prefer-dist
argument for composer install
and composer update
, then composer will try to download the packages' distributable instead of its source. For packages on GitHub this means, it downloads a zip file instead of cloning the repository.
It is possible that this still includes all the tests, but it is recommended to not include tests in the distributable. For packages on GitHub, tests are excluded if there is a .gitattributes
file with content like:
/tests export-ignore
/phpunit.xml export-ignore
Read more: I don't need your tests in my production (Reddit)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With