How do I get rid of composer-asset-plugin in yii2

旧街凉风 提交于 2019-12-08 12:17:44

问题


Since the fxp\composer-asset-plugin broke last year, I am continuously experiencing problems installing yii2.

whenever I run a composer update command it fails due to this composer asset plugin. Everyday a new error pops up. I have read number of articles, github issues, with Sam and Alexander (maintainers of Yii Framework) continuously replying to the same problem then would close the topic. none of the updates to this plugin seem to be a fool-proof solution.

Now instead of asking how to solve the errors caused by this plugin (assuming that no one has a 100% working solution till date, only workarounds that work only 'sometimes'),

how do I get rid of this plugin and can't I manually install the packages through bower or npm?

In short, I mean,

In Yii 2.0, is life possible without this plugin, which has become a problem creator instead of solving problems.


回答1:


You can use https://asset-packagist.org instead. Add this in composer.json:

"repositories": [
    {
        "type": "composer",
        "url": "https://asset-packagist.org"
    }
],

Only problem is assets are installed in the different folder so you need to change the aliases. Add this in some common config file:

'aliases' => [
    '@bower' => '@vendor/bower-asset',
    '@npm' => '@vendor/npm-asset',
],


来源:https://stackoverflow.com/questions/42731517/how-do-i-get-rid-of-composer-asset-plugin-in-yii2

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