S
S
sergey_mishin2019-02-08 18:37:37
Composer
sergey_mishin, 2019-02-08 18:37:37

Why does composer with --prefer-dist flag download all files?

I read that if you use install/ update/ requirewith a flag --prefer-source(or write it in the config in the section config - preferred-install), then the composer pulls all project files, including documentation, tests, examples, etc. Therefore, it is better to use it in production --prefer-dist(for example, they write about it here https:/ /phptoday.ru/post/5-sovetov-dlya-raboty-sc... )
But wherever I set this flag, with any command or in the config, the entire package is always downloaded. For example I tried chillerlan/php-database . Outcome: Same
QoQkq.png
with other libraries. Am I doing something wrong? Or have I misunderstood everything? Or, perhaps, some libraries are downloaded absolutely always as a whole set?
What should be done to download / or install files without unnecessary garbage?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitsliputsli, 2019-02-08
@Vitsliputsli

prefer is a preference, if there is no one selected, another one will be loaded.
source - sources, what you need if you want to edit a component (git).
dist - distribution, what you need, if you connect to the prod, it connects faster (zip).
And whether there will be documentation, tests and examples depends on whether they are put there during assembly or not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question