Exclude files from autoload_files.php

Installs: 37 176

Dependents: 2

Suggesters: 0

Security: 0

Stars: 17

Watchers: 1

Forks: 3

Open Issues: 0


v1.2.0 2020-05-05 05:25 UTC

This package is auto-updated.

Last update: 2020-08-11 05:28:58 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 either the 'autoload' section or the 'extra' section. The list of paths must be absolute from the vendor directory.

This plugin is invoked before the autoloader is dumped, either during install/update, or via the dump-autoload command.


    "require": {
        "illuminate/support": "^5.5"
    "autoload": {
        "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.