Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lichunqiang/composer-ignore-plugin
The composer plugin to remove useless files by yourself
https://github.com/lichunqiang/composer-ignore-plugin
composer-ignore-plugin composer-plugin
Last synced: 27 days ago
JSON representation
The composer plugin to remove useless files by yourself
- Host: GitHub
- URL: https://github.com/lichunqiang/composer-ignore-plugin
- Owner: lichunqiang
- License: mit
- Created: 2016-11-14T07:53:48.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-29T21:02:35.000Z (about 1 year ago)
- Last Synced: 2024-08-04T01:02:19.910Z (4 months ago)
- Topics: composer-ignore-plugin, composer-plugin
- Language: PHP
- Homepage:
- Size: 42 KB
- Stars: 21
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-composer - Composer-Ignore-Plugin - Enables you to remove files and folders from the vendor folder (to make a cleaner and smaller deployment to production). It's an alternative to `.gitattributes`. (Plugins / Support)
README
Composer Ignore Plugin [![version](https://img.shields.io/packagist/v/light/composer-ignore-plugin.svg?style=flat-square)](https://packagist.org/packages/light/composer-ignore-plugin) [![Download](https://img.shields.io/packagist/dt/light/composer-ignore-plugin.svg?style=flat-square)](https://packagist.org/packages/light/composer-ignore-plugin)
----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`:
```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`](https://github.com/fzaninotto/Faker/pull/1085) for example.
## LICENSE
[MIT](LICENSE)