Answer the question
In order to leave comments, you need to log in
How to update bower package in yii2?
I know that yii2 uses the fxp/composer-asset-plugin plugin, which allows you to manage bower packages through composer, but I can't figure out how to use it. In the composer.json file, I see the construction:
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
Answer the question
In order to leave comments, you need to log in
In fact, everything is quite simple. See:
1. Go here and find the right package.
2. Let's say we need font awesome:
3. Create an asset:
<?php
namespace backend\assets;
use yii\web\AssetBundle;
class FontAwesomeAsset extends AssetBundle
{
public $sourcePath = '@bower/components-font-awesome';
public $css = [
'css/font-awesome.min.css',
];
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question