Answer the question
In order to leave comments, you need to log in
How to make dependencies in Asset yii2?
Hello, I connect on the PageAsset page
<?php
namespace app\assets;
use yii\web\AssetBundle;
/**
* Main application asset bundle.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class PageAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'/web/page-asset/css/main.min.css',
];
public $js = [
'/web/page-asset/js/scripts.min.js',
'/web/page-asset/js/common-main.js',
'/web/page-asset/js/ajax.js',
];
public $depends = [
'yii\web\YiiAsset',
];
}
'assetManager' => [
'bundles' => [
'yii\web\JqueryAsset' => [
'js'=>[]
],
'yii\bootstrap\BootstrapPluginAsset' => [
'js'=>[]
],
'yii\bootstrap\BootstrapAsset' => [
'css' => [],
],
],
],
Answer the question
In order to leave comments, you need to log in
If some collector collects everything for you and you already have a minified file with everything, why do you need AssetsManager?
Remove it from depends, you specified a bunch of scripts and indicated that they are dependent on yii\web\YiiAsset, of course, the system connects the dependency to you earlier, and this makes sense.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question