Composer总是下载fontend资产

时间:2017-11-24 07:07:00

标签: yii2 composer-php

每次我使用作曲家安装Yii2的扩展时,它总是下载前端资产。它太慢了!我该如何解决这个问题? representation for application/json can be overridden

这是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" } } }

1 个答案:

答案 0 :(得分:0)

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