You can not, because you(as a dependency client) are not eligible to make decision about how your dependency should act. Its up to him! Just deliver your projects without dependency files in it, instead include composer.json.
This question has been asked before, every time with answer No or sth similar to it.
Here are some examples:
How to install specific files from a package using composer.json
How to config composer.json to retrieve specified files only?
UPDATE ## [important!]
It seems there is only one way somehow similar to what you need.
There is an option which composer-friendly projects developers may or may-not use, and its a tricky play with --prefer-dist
& .gitattributes
files.
The developer could use .gitattributes
file to ignore some of the files and folders during packaging for the --prefer-dist mode. sth like this:
/docs export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml export-ignore
Then while providing dependencies, Packagist uses these .zip file made in github to pull in the --prefer-dist dependencies, and then unarchives them once downloaded (much faster than cloning). Thus, If the developer, ignores tests, docs and other logically irrelevant files by listing them in .gitattributes, the archives won’t contain them, becoming much, much lighter.
It seems this is the only way, which again, is not based on code-client decision & obviously is a Producer-Developer-Oriented method.
But after all, you can check --prefer-dist while installing your desired dependency, may they've made this option available & you can get a much lighter version.