light/composer-ignore-plugin

ignore files by yourself

Installs: 1 378

Dependents: 0

Suggesters: 0

Security: 0

Stars: 21

Watchers: 1

Forks: 2

Open Issues: 1

Type:composer-plugin

2.0.1 2021-05-20 12:11 UTC

This package is auto-updated.

Last update: 2024-11-29 23:18:08 UTC


README

This plugin help us to remove the unused file or directories in vendor.

Installation

Both global or local install can work well.

1.Install globally, so every project can use the plugin.

$ composer global require "light/composer-ignore-plugin:~2.0"

2.Install locally

$ composer require "light/composer-ignore-plugin:~2.0" --dev

Usage

Define the ignore file or directory in composer.json, for example:

Before:

fzaninotto/faker/
├── CHANGELOG.md
├── composer.json
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── phpunit.xml.dist
├── readme.md
├── src
└── test

Configuration in composer.json:

{
	"extra": {
		"light-ignore-plugin": {
    	  "fzaninotto/faker": [
    	  	"test", 
    	  	"*.md", 
    	  	"LICENSE",
    	  	"Makefile",
    	  	"phpunit.xml.dist"
    	  ]
    	}
	}
}

After executed composer install, composer update, composer dump-autoload, The files will be removed.

When execute the composer install or composer update will finally trigger the autoload dump event

After:

fzaninotto/faker/
├── composer.json
└── src

Why this?

Thanks to open source, there are many useful packages helped us.

Generally, some files or folder in the installed package is useless, and when deploy to production system, reduce the files can make deploy clean.

Of cause, a lot of package had done this by add .gitattributes file, But also not all, fzaninotto/faker for example.

LICENSE

MIT