ignore dev dependencies in php composer

99封情书 提交于 2019-12-12 17:01:41

问题


I have developed a composer laravel based project that I need to install on a remote production server. The problem is I have limited permission/ access so my option is to "archive" the package( using composer archive) and unpack on the production.

What folders do I need to archive and how can I ignore the dev dependencies of the package as well as vendor dev dependencies?


回答1:


composer archive is likely not to help you, because this command creates an archive of a defined version of a package.

You probably want to upload the whole working application, and not only one package. You should create a little script that will create the archive file for you, which should do:

  • checkout the application from the repository in a new directory
  • run composer install --no-dev to install all required dependencies without dev-dependencies
  • optionally delete files that are not necessary on the server, like documentation, the .git folder, and other stuff
  • create the archive file from all these files
  • optionally upload that archive to the target server and unarchive there
  • optionally check basic functions and switch to the new uploaded version on the server


来源:https://stackoverflow.com/questions/43855771/ignore-dev-dependencies-in-php-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!