defyma/yii2-compress-asset

This solution enables you to dynamically combine js and css files to optimize the html page.

v1.0.2 2018-12-17 07:49 UTC

This package is auto-updated.

Last update: 2024-04-04 23:35:01 UTC


README

This solution enables you to dynamically combine js and css files to optimize the html page.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist defyma/yii2-compress-asset "*"

or add

"defyma/yii2-compress-asset": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

//App config
[
    'bootstrap'    => ['assetsAutoCompress'],
    'components'    => [
    //....
        'assetsAutoCompress' =>
        [
            'class' => '\defyma\assets\AssetsCompressComponent',
            'enabled'           => true,
            'jsCompress'        => true,
            'cssFileCompile'    => true,
            'jsFileCompile'     => true,
        ],
    //....
    ]
]