I've just finished a simple work done in Laravel 4 and I'm ready to Deploy on my server.
I found that the vendor folder has a size of 100MB and I wonder if it is necessary to upload all its subfolders. I suppose that I don't use the most of those libraries, is there a good practise to follow to deploy a Laravel project?
I haven't deployed an L4 app myself to this point, but will run into issues as I don't have git/composer access on my host server as well. Unless something clever comes along, FTP/SSH is my only avenue for getting my files on the server.
The /vendors
folder is absolutely required in order for your application to function. Think of vendors as the /core
folder in other frameworks. All of the heavy lifting in Laravel is managed through the packages contained inside of /vendors
, and so without that folder your app will just crash.
You better use
composer create-project laravel/laravel --prefer-dist <project directory>
To create your project. Your vendor dir space usage will start at 10MB, only. (I just did it it here and that's what downloaded for me).
And looks like you also can:
composer update --no-dev --prefer-dist
To reduce your current project space usage.
But... vendor directory and all its first level subdirectories are mandatory (as long as you are using all the packages you have installed), but there are some subdirectories inside them you may easily ignore when deploying, such as:
*/examples/*
*/docs/*
*/docs2/* (Doctrine)
*/tests/*
*/test/*
*/Tests/* (Carbon)
*/swiftmailer/swiftmailer/notes/*
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