Composer总是下载fontend资产

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Composer总是下载fontend资产相关的知识,希望对你有一定的参考价值。

每次我使用composer安装扩展到Yii2时,它总是下载前端资产。它太慢了!我该如何解决这个问题? This is what Composer download,every time I install the extension

这是Composer.json "name": "yiisoft/yii2-app-advanced", "description": "Yii 2 Advanced Project Template", "keywords": [ "yii2", "framework", "advanced", "project template" ], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "BSD-3-Clause", "support": { "issues": "https://github.com/yiisoft/yii2/issues?state=open", "forum": "http://www.yiiframework.com/forum/", "wiki": "http://www.yiiframework.com/wiki/", "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "stable", "require": { "php": ">=5.4.0", "yiisoft/yii2": "~2.0.6", "yiisoft/yii2-bootstrap": "~2.0.0", "yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0", "dmstr/yii2-adminlte-asset": "2.*", "ijackua/yii2-lepture-markdown-editor-widget": "dev-master", "aliyuncs/oss-sdk-php": "^2.2", "yiichina/yii2-md-editor": "*" }, "require-dev": { "yiisoft/yii2-debug": "~2.0.0", "yiisoft/yii2-gii": "~2.0.0", "yiisoft/yii2-faker": "~2.0.0", "codeception/base": "^2.2.3", "codeception/verify": "~0.3.1" }, "config": { "process-timeout": 1800 }, "repositories": { "0": { "type": "composer", "url": "https://packagist.phpcomposer.com" }, "packagist": { "type": "composer", "url": "https://packagist.laravel-china.org" } } }

答案

这是fiip / composer-asset-plugin的问题,Yii2使用它来下载NPM以及Bower资产。每次添加新库时,插件都会枚举NPM的所有版本以及项目所需的Bower资源,从而从Github下载大量数据。官方的Yii2开发人员正在考虑转向更好的NPM替代包管理器以及像https://asset-packagist.org/这样讨论的像Bazxswpoi这样的Bower https://github.com/yiisoft/yii2/issues/13064

以上是关于Composer总是下载fontend资产的主要内容,如果未能解决你的问题,请参考以下文章

如何使用Webpack Encore在Heroku上编译资产?

导致资产预编译在heroku部署上失败的代码片段

如何使用 Webpack Encore 在 Heroku 上编译资产?

Yii2 |需要凉亭资产/jquery

Azure 机器人微软Azure Bot 编辑器系列 : 机器人/用户提问回答模式,机器人从API获取响应并组织答案 (The Bot Framework Composer tutorial(代码片段

sh Ubuntu 16.04的跛行堆栈(PHP7,Nginx,MySql,MongoDB,PhpMyAdmin,Git,Node.js,Bower,Gulp,Docker,Composer(带资产插