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

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

liborm85/composer-vendor-cleaner
================================

Composer Vendor Cleaner removes unnecessary development files and directories from vendor directory.

1.7.1(2y ago)35342.7k—0.2%41MITPHPPHP &gt;=5.6.0CI passing

Since Oct 27Pushed 5mo ago3 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (15)Used By (1)

Composer Vendor Cleaner [![Packagist](https://camo.githubusercontent.com/835099d3aa7228363d0e53817e851abb3aef011dff81645c4d1c0d5a2a54003b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c69626f726d38352f636f6d706f7365722d76656e646f722d636c65616e65722e737667)](https://packagist.org/packages/liborm85/composer-vendor-cleaner)
===========================================================================================================================================================================================================================================================================================================================================================

[](#composer-vendor-cleaner-)

This composer plugin removes unnecessary development files and directories from `vendor` directory.

Installation
------------

[](#installation)

Local installation to project:

```
composer require liborm85/composer-vendor-cleaner

```

Global installation:

```
composer global require liborm85/composer-vendor-cleaner

```

Requirements
------------

[](#requirements)

- PHP 5.6.0+

Configuration
-------------

[](#configuration)

Development files and directories to remove can be defined in `composer.json` file in [`extra`](https://getcomposer.org/doc/04-schema.md#extra) data attribute per new key `dev-files`. Glob pattern syntax is fully supported.

Example:

```
"extra": {
    "dev-files": {
        "/": [                  // means: find in all library packages directories and bin directory
            "tests/",           // means: tests directory whatever
            "docs/",
            ".travis.yml"       // means: .travis.yml file whatever
        ],
        "*/*": [                // means: find in all library packages directories, but NOT in bin directory
            "*.sh"
        ],
        "bin": [                // means: find in composer bin directory
            "*.bat"
        ],
        "twig/twig": [          // means: find only in twig/twig package directory
            "doc/",
            "/drupal_test.sh"   // means: only file in root directory of twig/twig package
        ],
        "symfony/*": [          // means: find in all symfony packages
            "Tests/"
        ],
        "other/package": [
            "/src/**/*.md"      // means: find whatever all md files in src directory, eg.: /src/dir1/test.md, /src/dir1/dir2/readme.md
        ],
        "example/package": [    // means: remove all files and directories in language directory without cs.php file
            "languages/*",
            "!languages/cs.php" // means: exclude cs.php file from remove
        ]
    }
}

```

Development files and directories can also be defined in an external json file, by specifying the relative path to this file in the `dev-files` key in the root composer.json. The format is the same as above.

```
"extra": {
    "dev-files": "composer.dev-files.json"
}

```

Example of `composer.dev-files.json` file:

```
{
  "/": [
    ".github/"
  ],
  "twig/twig": [
    "doc/"
  ]
}

```

For additional configuration can be used [`config`](https://getcomposer.org/doc/04-schema.md#config) attribute.

- `match-case` *(default: `true`)* - Match case of name files and directories.
- `remove-empty-dirs` *(default: `true`)* - Removes empty directories.
- `no-dev-only` *(default: `false`)* - If is set `true` start the cleanup only if the composer command is run with `--no-dev`.

Example:

```
"config": {
    "dev-files": {
        "match-case": false,
        "remove-empty-dirs": false
    }
}

```

Why a new plugin?
-----------------

[](#why-a-new-plugin)

Some composer packages contain files and directories that do not belong to production servers, but composer does not solve this.

Exists a lot of plugins for composer trying to solve this issue, they don't have advanced patterns to filtering or they are not user definable. Or some have no configuration and it works automatically and delete almost everything and then the package does not work.

That's why I created a new one that allows advanced filtering by glob patterns.

If you miss a feature or find bug, please, create an [issue](https://github.com/liborm85/composer-vendor-cleaner/issues).

License
-------

[](#license)

MIT

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance47

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 98.7% 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 ~101 days

Recently: every ~232 days

Total

14

Last Release

1082d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/68b49868b3a1487e6272819f3b8508cbead8c14b28cb0fd0df48a9c01fd0423f?d=identicon)[liborm85](/maintainers/liborm85)

---

Top Contributors

[![liborm85](https://avatars.githubusercontent.com/u/1298652?v=4)](https://github.com/liborm85 "liborm85 (147 commits)")[![ceesgeene](https://avatars.githubusercontent.com/u/10079586?v=4)](https://github.com/ceesgeene "ceesgeene (1 commits)")[![fbrinker](https://avatars.githubusercontent.com/u/5345116?v=4)](https://github.com/fbrinker "fbrinker (1 commits)")

---

Tags

cleanercomposercomposer-pluginphpremovephpcomposercomposer-plugindeletecleanercleanupremoveignore.gitattributes

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mnsami/composer-custom-directory-installer

A composer plugin, to help install packages of different types in custom paths.

1395.0M52](/packages/mnsami-composer-custom-directory-installer)[arokettu/composer-license-manager

License management plugin for Composer

61207.9k](/packages/arokettu-composer-license-manager)[light/composer-ignore-plugin

ignore files by yourself

211.4k](/packages/light-composer-ignore-plugin)[szepeviktor/composer-envato

Composer plugin for Envato

3715.2k1](/packages/szepeviktor-composer-envato)[avored/module-installer

A composer plugin, to help install modules for AvoREd e commerce applications.

139.1k14](/packages/avored-module-installer)[mage2/module-installer

A composer plugin, to help install modules for AvoREd e commerce applications.

132.0k](/packages/mage2-module-installer)

PHPackages © 2026

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