问题
I have installed yii2-admin module, located in /vendor/mdmsoft/yii2-admin but I don't want it to load its own asset bundle. It there any way to disable this module asset bundle?
回答1:
Yes, it's possible and even mentioned in official docs here. One way to do it is through application config:
return [
// ...
'components' => [
'assetManager' => [
'bundles' => [
'mdm\admin\AdminAsset' => false,
],
],
],
];
Another way - during runtime through component:
\Yii::$app->assetManager->bundles['mdm\admin\AdminAsset'] = false;
来源:https://stackoverflow.com/questions/30472821/yii2-disable-asset-of-a-vendor-module