Exclude files from autoload_files.php

Installs: 171 881

Dependents: 2

Suggesters: 0

Security: 0

Stars: 20

Watchers: 1

Forks: 3

Open Issues: 0


v2.0.0 2020-09-25 22:01 UTC

This package is auto-updated.

Last update: 2021-04-07 21:06:49 UTC


Build Status Coverage Status License GitHub Tag

A Composer plugin for excluding files required by packages using the 'files' autoloading mechanism.

This is useful for ignoring files required for bootstrapping a package or that provide PHP functions, for example.

Resolves composer/composer#5029


The plugin can be installed locally or globally.

$ composer require mcaskill/composer-exclude-files


You can only ignore files from your main composer.json. File exclusions of dependencies' composer.jsons are ignored.

From your main composer.json, add the exclude-from-files property to the extra section. The list of paths must be relative to this composer manifest.

This plugin is invoked before the autoloader is dumped, such as with the commands install, update, and dump-autoload.


    "require": {
        "illuminate/support": "^5.5"
    "extra": {
        "exclude-from-files": [

The plugin will traverse each package and remove all files in the paths configured above from the prepared autoload map. The vendor files themselves are not removed. The root package is ignored.

The resulting effect is the specified files are never included in vendor/composer/autoload_files.php.


This is licensed under MIT.