PHPackages                             0xch/composer-vendor-cleanup - 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. 0xch/composer-vendor-cleanup

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

0xch/composer-vendor-cleanup
============================

Removes whitelisted unnecessary files (like tests/docs etc.) from vendor directory

v1.1.0(4y ago)220.2k↓38.5%1MITPHPPHP &gt;=5.6

Since Oct 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/0xch/composer-vendor-cleanup)[ Packagist](https://packagist.org/packages/0xch/composer-vendor-cleanup)[ RSS](/packages/0xch-composer-vendor-cleanup/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/76a25dc92c02b32f189089b04d6f4b4bd8446dcf187c70c3ffa38e53ec02afd7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f307863682f636f6d706f7365722d76656e646f722d636c65616e75702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/0xch/composer-vendor-cleanup)[![Total Downloads](https://camo.githubusercontent.com/81745b75150f26783b03f864020cf856fc95786e8aa1729a07a6f028cca03f4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f307863682f636f6d706f7365722d76656e646f722d636c65616e75702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/0xch/composer-vendor-cleanup)

Composer vendor cleanup
=======================

[](#composer-vendor-cleanup)

This is a simple script for the Composer to remove unnecessary files (documentation/examples/tests etc.) from included vendor packages. Therefore it's a script it can be easily used as part of a deploy script.

In my projects it saves about 20-30% of vendor size.

It uses predefined whitelist (`rules.json`) to remove files. So the risk of not working on included packages is reduced. Script is based on rules from barryvdh's package  .

Feel free to submit pull requests with new rules or features.

### Installation

[](#installation)

Add to composer:

```
composer require 0xch/composer-vendor-cleanup

```

Then add to your `composer.json`:

```
"scripts": {
    "cleanVendor": [
        "Oxch\\Composer\\CleanupScript::cleanVendor"
    ]
}

```

(optional) Copy `rules.json` to custom dir and modify for your case and pass filename as argument to composer.

### Usage

[](#usage)

Once installed just run command (defined in **Installation** step):

```
composer cleanVendor    #use default rules config file
composer cleanVendor customRules.json    #use custom rules config file

```

It will go via all installed packages which are on the whitelist and remove unnecessary files.

### Look for big files

[](#look-for-big-files)

You can use this command to display possible unnecessary files which can be deleted by adding to your custom rules config file.

```
du -hd 5 vendor/ | sort -h | grep -Pi "/(tests?|examples?|samples?)$"

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~197 days

Total

4

Last Release

1821d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e76b0f4299801a542aae01d101568e3b956afcb94ae8feec415f9835d9ee5ad?d=identicon)[0xch](/maintainers/0xch)

---

Top Contributors

[![0xch](https://avatars.githubusercontent.com/u/4288821?v=4)](https://github.com/0xch "0xch (8 commits)")

### Embed Badge

![Health badge](/badges/0xch-composer-vendor-cleanup/health.svg)

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

###  Alternatives

[composer/satis

Simple Repository Generator

3.3k1.4M17](/packages/composer-satis)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[magento/magento-composer-installer

Composer installer for Magento modules

7523.3M318](/packages/magento-magento-composer-installer)[larapack/hooks

A Laravel Hook system

2171.5M21](/packages/larapack-hooks)[ramsey/conventional-commits

A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook action!

1931.2M122](/packages/ramsey-conventional-commits)[dominikb/composer-license-checker

Utility to check for licenses of dependencies and block/allow them.

563.8M9](/packages/dominikb-composer-license-checker)

PHPackages © 2026

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