as-milano / yii2-minify
Yii2 View component with minification css & js
dev-master
2016-02-04 16:48 UTC
Requires
- mrclay/minify: ~2.2
- yiisoft/yii2: ~2.0
This package is auto-updated.
Last update: 2025-01-29 05:11:29 UTC
README
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'
]
// ...
]