You cannot, because you (as a client-dependent) do not have the right to decide how your addiction should act. Its up to him! Just deliver your projects without dependency files, turn on composer.json instead.
This question has been asked before, each time with a No or sth answer similar to it.
Here are some examples:
How to install specific files from a package using composer.json
How to configure composer.json to download specified files only?
UPDATE ## [important!]
There seems to be only one way similar to what you need.
There is an option that developers may or may not use, and its complex game with --prefer-dist and .gitattributes .
The developer could use the .gitattributes file to ignore some files and folders during packaging for -prefer-dist mode. sth like this:
/docs export-ignore /tests export-ignore /.gitattributes export-ignore /.gitignore export-ignore /phpunit.xml export-ignore
Then when providing dependencies, Packagist uses this .zip file made in github to drag out the -prefer-dist dependencies and then unzip them after loading (much faster than cloning). Thus, if a developer ignores tests, documents, and other logically inappropriate files by listing them in .gitattributes, the archives do not contain them, becoming much easier.
This seems to be the only way that, again, is not based on a client-code solution and, obviously, is a manufacturer-oriented tool.
But you can check -prefer-dist when installing the necessary dependency, maybe they made this option available, and you can get a much lighter version.
source share