samdark / yii2-cookbook

Yii 2.0 Community Cookbook
1.44k stars 297 forks source link

Debug Toolbar and Asset processing with Grunt #101

Closed ghost closed 8 years ago

ghost commented 8 years ago

In "Asset processing with Grunt", you suggest turning off Yii asset management completely by doing the following:

'bundles' => false,

In my experience, that is not the best method because, in addition to turning off the asset management for all the assets you are adding via Grunt, it also causes Yii not to load the debug toolbar assets. So instead of setting bundles to false across the board, I do the following:

'bundles' => [
    'yii\web\JqueryAsset' => false,
    'yii\bootstrap\BootstrapAsset' => false,
    'yii\web\YiiAsset' => false,
    'yii\validators\ValidationAsset' => false,
    'yii\widgets\ActiveFormAsset' => false
],

That way, yii\debug\ToolbarAsset will still load and the debug toolbar will be visible and functional.

samdark commented 8 years ago

Thanks!