Using Composer Without GitIgnoring Vendor

In Lorna Jane’s tutorial she covers a way of using composer without ignoring the vendor directory.

For Snappy we also commit the vendor directory but we handle it a little different. Instead of adding lines to .gitignore we utilize the composer prefer-dist flag which downloads the source instead of any git submodules.

To keep from having to always remember the flag you can add this to your composer.json:

"config": {
    "preferred-install": "dist"
},

I wish this was documented better and a good solution for those on shared hosts or for those that do not wish to run composer update install on a prod.

Visit Resource →

Filed in: Laravel
Laravel News Partners

Laravel Jobs

Senior Full-Stack Developer
Atlanta, GA - (remote) USA ONLY
Curricula
PHP Laravel Developer
London
Investoo
Senior Backend Developer
Australia
Tixel
CTO
Copenhagen
Tjommi
Looking for Senior Full-stack Laravel/React.js Javascript API Developer - Immediate (Full-time)
Remote
ApproveMe // Document Signing

Newsletter

Join 31,000+ others and never miss out on new tips, tutorials, and more.