as-milano/yii2-minify Yii2 View component with minification css & js

minifyviewjscss

Yii 2 Minify View Component

The main feature of this component - concatenate and compress files connected through "AssetBundle".

Fork of another extension with some additional features:

  • Ability to just concatenate files (without compression);
  • Ability to choose between fast and safe methods of checking that original file was changed.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist as-milano/yii2-minify "*"

or add

"as-milano/yii2-minify": "*"

to the require section of your composer.json file.

Configure

In the application configuration add configuration for the View component:

'components' => [
    // ...
    'view' => [
        'class' => 'milano\minify\View',
        'enableMinify' => !YII_DEBUG,
        'minifyCss' => true,
        'compressCss' => true,
        'minifyJs' => true,
        'compressJs' => true,
        'minifyPath' => '@webroot/assets/minify',
        'jsPosition' => [\yii\web\View::POS_END],
        'expandImports' => true,
        'compressOutput' => true,
        'hashMethod' => 'sha'
    ]
    // ...
]

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

No stable releases.

Comments



No stable releases.



MIT license
Stats
0 github stars & 0 github forks
0 downloads in the last day
0 downloads in the last 30 days
338 total downloads