Vendors May Not Be Essential


I need to know all of folders(except for yiisoft, of course) under the vendors folder are essential or not. For example, I don’t use composer and I’ll never use composer. Likewise swiftmailer… So I want to delete it under vendors folder. Can you tell me which of these are safe to delete? ( Even I’ll be deprived to use of these features/libraries… )

Any reason, why you wish to delete vendors folder? These are part of core framework (and/or any additional third party extensions) and normally do not need to be manipulated manually. Just like you do not delete DetailView class from yii\widgets, if you do not need it.

However, you can manage this better if you use composer, then you can control what is needed and what is not at a package level. You can remove the packages/extensions that you do not need, from require section from composer.json on app root) and run a composer update.

Any other packages (not in your app composer.json) but which is automatically installed in the vendors folder need to be left as it is - because it would be used by or is a dependency for one of the packages (e.g. yiisoft) which you already have.

are you concerned about size?