rmrevin / yii2-minify-view

Yii2 View component with minification css & js
MIT License
191 stars 67 forks source link

Ignoring conditional tag for js files #16

Closed mzysk closed 9 years ago

mzysk commented 9 years ago

When i am using plugin with this configuration:

'class' => '\rmrevin\yii\minify\View',
            'enableMinify' => true,
            'minifyJs' => true,
            'minifyCss' => false,
            'web_path' => '', // path alias to web base
            'base_path' => '@frontend/web', // path alias to web base
            'minify_path' => '@frontend/web/assets/minify', // path alias to save minify result
            'js_position' => [ \yii\web\View::POS_END ], // positions of js files to be minified
            'force_charset' => 'UTF-8', // charset forcibly assign, otherwise will use all of the files found charset
            //'expand_imports' => true, // whether to change @import on content
            'compress_output' => true, // compress result html page

conditional tag for html5shiv and selectivizr are missing. Assets are added like that:

class ShivAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [];
    public $js = [
        'assets/js/html5shiv.min.js'
    ];
    public $jsOptions = ['condition' => 'lte IE 9', 'position' => \yii\web\View::POS_HEAD];
    public $depends = [
        'yii\web\JqueryAsset',
    ];
}

when i am changing back minifyJs to true - conditions are visible.

rmrevin commented 9 years ago

Sorry for the long answer. The task is accepted.

rmrevin commented 9 years ago

Fixed in version 1.9.0