Answer the question
In order to leave comments, you need to log in
Why does composer with --prefer-dist flag download all files?
I read that if you use install
/ update
/ require
with 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
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
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 questionAsk a Question
731 491 924 answers to any question