dg/composer-cleaner

Victor The Cleaner: removes unnecessary files from vendor directory.

Installs: 1 440 297

Dependents: 28

Suggesters: 0

Security: 0

Stars: 134

Watchers: 14

Forks: 19

Open Issues: 7

Type:composer-plugin

v2.2.1 2022-04-02 16:11 UTC

This package is auto-updated.

Last update: 2024-10-30 01:32:48 UTC


README

Downloads this Month Tests

This tool removes unnecessary files and directories from Composer vendor directory.

The Cleaner leaves only directories containing the source files needed to use the libraries. These are located according to the autoload section of composer.json in each installed library. Conversely for example, tests are files that are not needed for use, so they are removed.

Installation

composer require dg/composer-cleaner

Then simply run composer update or composer require ... and the Cleaner automatically removes unnecessary files when new libraries are installed.

Configuration

Some libraries also requires other files/directories, which the the Cleaner judged to be unnecessary. In this case, you can list them (specify paths to be ignored), in the configuration and the tool will keep them. Or you can specify that some libraries should not be cleaned at all.

Simply add a extra > cleaner-ignore section to composer.json file:

{
	"extra": {
		"cleaner-ignore": {
			"slevomat/eet-client": [  // name of package
				"wsdl*"               // list of files or subdirectories, you can use wildcards `*` and `?`
			],

			"mpdf/mpdf": true         // ignores whole package
		}
	}
}

Support Project

Do you like Victor The Cleaner? Are you looking forward to the new features?

Donate