PHPackages                             mediamonks/composer-vendor-cleaner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mediamonks/composer-vendor-cleaner

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mediamonks/composer-vendor-cleaner
==================================

Removes as much as possible from your vendor dir when space or number of files is important

v1.1.1(8y ago)2960.0k↓29.1%4[1 issues](https://github.com/mediamonks/composer-vendor-cleaner/issues)MITPHPPHP ^5.4|^7.0

Since Dec 6Pushed 8y ago5 watchersCompare

[ Source](https://github.com/mediamonks/composer-vendor-cleaner)[ Packagist](https://packagist.org/packages/mediamonks/composer-vendor-cleaner)[ Docs](https://www.mediamonks.com/)[ RSS](/packages/mediamonks-composer-vendor-cleaner/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/2a46724d322156637fbc55c32e3789960821c7a174eea4b6ba17ab7a573c2fcc/68747470733a2f2f706f7365722e707567782e6f72672f6d656469616d6f6e6b732f636f6d706f7365722d76656e646f722d636c65616e65722f646f776e6c6f616473)](https://packagist.org/packages/mediamonks/composer-vendor-cleaner)[![Latest Stable Version](https://camo.githubusercontent.com/b1da52784c13af75ec6e4be664cf0332a20f6c5074bd98e4112e6b08d47bbfc3/68747470733a2f2f706f7365722e707567782e6f72672f6d656469616d6f6e6b732f636f6d706f7365722d76656e646f722d636c65616e65722f762f737461626c65)](https://packagist.org/packages/mediamonks/composer-vendor-cleaner)[![Latest Unstable Version](https://camo.githubusercontent.com/3eb190e1669d729f06c9bce6137c40d24894b435272898bc50628b56c9fb3e6e/68747470733a2f2f706f7365722e707567782e6f72672f6d656469616d6f6e6b732f636f6d706f7365722d76656e646f722d636c65616e65722f762f756e737461626c65)](https://packagist.org/packages/mediamonks/composer-vendor-cleaner)[![License](https://camo.githubusercontent.com/c094323cefcc051a130ec6cbf13a2f48b7c7ef44b57f539960aee4880440db5f/68747470733a2f2f706f7365722e707567782e6f72672f6d656469616d6f6e6b732f636f6d706f7365722d76656e646f722d636c65616e65722f6c6963656e7365)](https://packagist.org/packages/mediamonks/composer-vendor-cleaner)

MediaMonks Composer Vendor Cleaner
==================================

[](#mediamonks-composer-vendor-cleaner)

Sometimes there are still some unfortunate cases when you need to send your vendor dir to some place and you want it to go as fast as possible. This package provides a simple script which will try to remove as much stuff as possible without breaking your app.

Don't forget to run `composer install` with `--no-dev` when creating a package for non-development environments, it will already save you loads space and files if you have packages defined in `require-dev`!

How it works
------------

[](#how-it-works)

The script simply reads all package dirs within the vendor dir (`/`) and removed files from that dir which are not used for running your project. For most packages this means it will remove docs and tests but also the composer files, licenses and readme's.

Since not all packages can be cleaned the same way the `type` in `composer.json` of the package is used to determine the cleaning handler.

Currently these handlers are available:

### SymfonyBundleHandler

[](#symfonybundlehandler)

Used when the type is set to `symfony-bundle`, removes the `Tests` dir if it's present

### DefaultHandler

[](#defaulthandler)

For all other types, removes all folders except the ones that are defined in the `autoload` section of the composer.json

Usage
-----

[](#usage)

Clean up current vendor dir:

```
php vendor/mediamonks/composer-vendor-cleaner/bin/clean

```

Clean up specific vendor dir:

```
php vendor/mediamonks/composer-vendor-cleaner/bin/clean --dir /path/to/different/vendor/

```

To just view what it will do without removing the actual files you can do a dry run:

```
php vendor/mediamonks/composer-vendor-cleaner/bin/clean --dry-run

```

Options
-------

[](#options)

You pass the location of a json file to set some options which can influence the cleaning process:

```
php vendor/mediamonks/composer-vendor-cleaner/bin/clean --options /path/to/options.json

```

The current supported options are:

- Excluding entire packages
- Excluding specific dirs for a package
- Excluding specific files for a package

You can simply look at the provided `options.json` (*which is used by default*) to see how the options are defined.

Disclaimer
----------

[](#disclaimer)

This script is under development and is not tested extensively yet so use at your own risk!

We can use your help!
---------------------

[](#we-can-use-your-help)

This script was mainly created to clean up Symfony Framework projects but with your help we can make it work for other frameworks too. Please create your own handlers, improve the cleaning on current handlers and send in a PR.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~228 days

Total

3

Last Release

3042d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4

v1.1.1PHP ^5.4|^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/411c94cbec325fa9a747f4677bb07355b374a0f01008e48c33f809627004fa5d?d=identicon)[mediamonks](/maintainers/mediamonks)

---

Top Contributors

[![mediamonks-robert](https://avatars.githubusercontent.com/u/7644785?v=4)](https://github.com/mediamonks-robert "mediamonks-robert (12 commits)")[![darkwhispering](https://avatars.githubusercontent.com/u/994566?v=4)](https://github.com/darkwhispering "darkwhispering (2 commits)")[![slootjes](https://avatars.githubusercontent.com/u/17158090?v=4)](https://github.com/slootjes "slootjes (1 commits)")

---

Tags

cleanercomposervendorcomposervendor

### Embed Badge

![Health badge](/badges/mediamonks-composer-vendor-cleaner/health.svg)

```
[![Health](https://phpackages.com/badges/mediamonks-composer-vendor-cleaner/health.svg)](https://phpackages.com/packages/mediamonks-composer-vendor-cleaner)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
