Do you have to run Composer on localhost and on production?

前端 未结 2 654
情书的邮戳
情书的邮戳 2021-01-12 09:22

I\'m new to Composer (getcomposer.org) and wasn\'t sure how it works if I install a package locally using Composer and then push my codebase to my production server using Gi

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-12 09:59

    It depends how are you working. If you, like getcomposer.org says, are ignoring the "vendor" folder then you need to run it again. If you are versioning the "vendor" folder then you don't need to run it again.

    Have in mind that composer will get in charge of managing your dependencies versions, so there is no need to put your dependencies files under versioning. If you put these files under git you will only make your repository bigger.

    Read https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies.

    For clarification when you ignore the "vendor" folder Git don't track the files under the folder so if you clone the repo it will be like composer never was executed

提交回复
热议问题