我有一个非常简单的AssetBundle:
    

use yii\web\AssetBundle;

/**
 * ImagizerAsset
 */
class ImagizerAsset extends AssetBundle
{
    public $sourcePath = '@app/components/widgets/imagizer/assets';

    public $css = [
        'css/imagizer.css'
    ];

    public $js = [
        'js/imagizer.js',
    ];

    public $depends = [
        'app\assets\BowerCropperAsset'
    ];
}


如果更改捆绑软件中的JavaScript,则它不会在开发模式下发布到web / asset目录。我必须每次都删除web / asset目录才能拥有最新版本。这很烦人。我该怎么办?

最佳答案

已经回答here

将此添加到您的资产包:

public $publishOptions = [
    'forceCopy' => YII_DEBUG,
];


有关更多选项和详细说明,请查看链接的答案。

10-06 03:53