PHPackages                             emanuellopes/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. emanuellopes/composer-vendor-cleaner

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

emanuellopes/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)01.8kMITPHPPHP ^5.4|^7.0

Since Dec 6Pushed 4y agoCompare

[ Source](https://github.com/emanuellopes/composer-vendor-cleaner)[ Packagist](https://packagist.org/packages/emanuellopes/composer-vendor-cleaner)[ Docs](https://www.mediamonks.com/)[ RSS](/packages/emanuellopes-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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

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

2989d 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/2ffabc0cc3633fc65d4ad975e727de60a10d4e0ed090a900676e857b8047c255?d=identicon)[emanuelx](/maintainers/emanuelx)

---

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

composervendor

### Embed Badge

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

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

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[franzl/studio

Develop your Composer libraries with style

1.1k634.5k15](/packages/franzl-studio)[clue/phar-composer

Simple phar creation for any project managed via Composer

862881.6k29](/packages/clue-phar-composer)[friendsoftypo3/content-blocks

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

96374.6k23](/packages/friendsoftypo3-content-blocks)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)

PHPackages © 2026

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