PHPackages                             captain-flam/composer-cleanup-plugin - 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. captain-flam/composer-cleanup-plugin

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

captain-flam/composer-cleanup-plugin
====================================

A composer cleanup plugin, to remove tests and documentation to save space

2.0(4y ago)04MITPHP

Since Mar 19Pushed 4y agoCompare

[ Source](https://github.com/Captain-FLAM/composer-cleanup-plugin)[ Packagist](https://packagist.org/packages/captain-flam/composer-cleanup-plugin)[ RSS](/packages/captain-flam-composer-cleanup-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Composer Cleanup Plugin
=======================

[](#composer-cleanup-plugin)

Remove tests &amp; documentation from the vendor dir. Based on [laravel-vendor-cleanup](https://github.com/barryvdh/laravel-vendor-cleanup) but implemented as a Composer Plugin instead of a Laravel command.

Usually disk size shouldn't be a problem, but when you have to use FTP to deploy or have very limited disk space, you can use this package to cut down the vendor directory by deleting files that aren't used in production (tests/docs etc).

> **Note:** This package is still experimental, usage in production is not recommended. In normal circumstances, you shouldn't care about disk space! Try deploying with SSH/Git instead.

Install
-------

[](#install)

Add this in your composer.json:

```
  "require": {
    "captainflam/composer-cleanup-plugin": "master"
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/Captain-FLAM/composer-cleanup-plugin.git"
    }
  ],

```

Usage
-----

[](#usage)

This plugin will work automatically on any packages installed as `dist`. Therefore, if you are using it to build a package archive, simply run `composer install` with the `--prefer-dist` option.

What does it do?
----------------

[](#what-does-it-do)

For every installed or updated package in the default list, in general:

1. Remove documentation, such as README files, docs folders, etc.
2. Remove tests, PHPUnit configs, and other build/CI configuration.

Some packages don't obey the general rules, and remove more/less files. Packages that do not have rules added are ignored.

Adding rules
------------

[](#adding-rules)

Please submit a PR to [src/CleanupRules.php](./src/CleanupRules.php) to add more rules for packages. Make sure you test them first, sometimes tests dirs are classmapped and will error when deleted.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.4% 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

Unknown

Total

1

Last Release

1513d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96a0be4c618af761382c5ffacfc7ad87257946be9861822721871b858f910be1?d=identicon)[Captain-FLAM](/maintainers/Captain-FLAM)

---

Top Contributors

[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (31 commits)")[![Captain-FLAM](https://avatars.githubusercontent.com/u/2856272?v=4)](https://github.com/Captain-FLAM "Captain-FLAM (9 commits)")[![mmodler](https://avatars.githubusercontent.com/u/1906217?v=4)](https://github.com/mmodler "mmodler (8 commits)")[![widoz](https://avatars.githubusercontent.com/u/1917784?v=4)](https://github.com/widoz "widoz (2 commits)")[![matthewhutchings](https://avatars.githubusercontent.com/u/10011888?v=4)](https://github.com/matthewhutchings "matthewhutchings (1 commits)")[![kranack](https://avatars.githubusercontent.com/u/2787828?v=4)](https://github.com/kranack "kranack (1 commits)")[![phy25](https://avatars.githubusercontent.com/u/331403?v=4)](https://github.com/phy25 "phy25 (1 commits)")[![XedinUnknown](https://avatars.githubusercontent.com/u/1428973?v=4)](https://github.com/XedinUnknown "XedinUnknown (1 commits)")

### Embed Badge

![Health badge](/badges/captain-flam-composer-cleanup-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/captain-flam-composer-cleanup-plugin/health.svg)](https://phpackages.com/packages/captain-flam-composer-cleanup-plugin)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M14](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M441](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

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