The size of Google php API Library is very large. I just want to send an email with the library. How can I reduce its size?
To reduce the vendor library size,
google/apiclient
offers a configuration on composer.json to run a cleanup script post-update.
This way you can specify only your required apis,
to reduce storage size on production.
Especially if you are going to use it on tighter storage requirement environment, like serverless architecture.
Reference: https://packagist.org/packages/google/apiclient
{
"require": {
"google/apiclient": "^2.7"
},
"scripts": {
"post-update-cmd": "Google\\Task\\Composer::cleanup"
},
"extra": {
"google/apiclient-services": [
"Drive",
"YouTube"
]
}
}
You may want remove the entire apiservices folder first, and then do a composer update, if you already installed a full set of api.
$ rm -r vendor/google/apiclient-services
$ composer update
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