phpcomposer-phppackagist

How to leave out all unnecessary stuff in composer for final build?


I just learned about composer and are about to use it for the first time in a bigger project. One problem I have: My project is actually about 24,5MB, 24 of those come from my vendors directory.

As far as I see, in most libraries included in vendors, composer also delivers documentation files, testings and so on. Is there an automated way to leave out all those? I just want to pack the license and the really needed source files into the final build.

Thanks a lot! :-)


Solution

  • Although I asked this question more than a year ago, it still is up to date for me. Just wanted to post the solution i eventually went with.

    I found a very cool project named 'altax' -> https://github.com/kohkimakimoto/altax. It allowed me to integrate all steps I needed to take in a fully controllable deploy process.

    My final deploy command will first update all vendors and then run phpunit just to make sure. If all goes fine, it copies the current project entirely and leaves out all useless stuff (like .git, doc folders, tests, and so on). This shrinks my project from 25 to ~2.4 MB.

    To finish things, it will build and bundle the documentation and create two releases - one zipped and ready to place in the update channel and one which is going to sales.

    Best part is that I wrote the deployment myself with some easy tools and can fully control what it does.