skeeks/yii2-assets-auto-compress Automatically compile and merge files js + css + html in yii2 project

frameworkassetsjscssappskeekssxautoassets

Automatically compile and merge files js + css + html in yii2 project.

This solution enables you to dynamically combine js and css files to optimize the html page. This allows you to improve the performance of google page speed.

This tool only works on real sites. On the local projects is not working!

Latest Stable Version Total Downloads Reference Status Dependency Status

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist skeeks/yii2-assets-auto-compress "*"

or add

"skeeks/yii2-assets-auto-compress": "*"

How to use

//App config
[
    'bootstrap'    => ['assetsAutoCompress'],
    'components'    =>
    [
    //....
        'assetsAutoCompress' =>
        [
            'class'         => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
        ],
    //....
    ]
]
//App config with all options
[
    'bootstrap'    => ['assetsAutoCompress'],
    'components'    =>
    [
    //....
        'assetsAutoCompress' =>
        [
            'class'                         => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
            'enabled'                       => true,

            'readFileTimeout'               => 3,           //Time in seconds for reading each asset file

            'jsCompress'                    => true,        //Enable minification js in html code
            'jsCompressFlaggedComments'     => true,        //Cut comments during processing js

            'cssCompress'                   => true,        //Enable minification css in html code

            'cssFileCompile'                => true,        //Turning association css files
            'cssFileRemouteCompile'         => false,       //Trying to get css files to which the specified path as the remote file, skchat him to her.
            'cssFileCompress'               => true,        //Enable compression and processing before being stored in the css file
            'cssFileBottom'                 => false,       //Moving down the page css files
            'cssFileBottomLoadOnJs'         => false,       //Transfer css file down the page and uploading them using js

            'jsFileCompile'                 => true,        //Turning association js files
            'jsFileRemouteCompile'          => false,       //Trying to get a js files to which the specified path as the remote file, skchat him to her.
            'jsFileCompress'                => true,        //Enable compression and processing js before saving a file
            'jsFileCompressFlaggedComments' => true,        //Cut comments during processing js

            'htmlCompress'                  => true,        //Enable compression html
            'noIncludeJsFilesOnPjax'        => true,        //Do not connect the js files when all pjax requests
            'htmlCompressOptions'           =>              //options for compressing output result
            [
                'extra' => false,        //use more compact algorithm
                'no-comments' => true   //cut all the html comments
            ],     
        ],
    //....
    ]
]

Links

Demo (view source code)

Screenshot

SkeekS CMS admin panel


SkeekS CMS admin panel


SkeekS CMS admin panel


SkeekS CMS admin panel


skeeks!
SkeekS CMS (Yii2) — fast, simple, effective!
skeeks.com | cms.skeeks.com

Changelog

CHANGELOG

1.3.1.2

  • Fixed local read files

1.3.1.1

  • Fixed webroot setting

1.3.1

1.3.0

1.2.3.1

  • http_code 200

1.2.3

  • Do not connect the js files when all pjax requests.

1.2.2

1.2.1

  • Html compression by default no extra

1.2.0

  • Added html compression

1.1.2

1.1.1

  • fixed bug download css from remoute server

1.1

  • Removed unnecessary settings preloader

1.0.4

  • Added timeout on file reading

1.0.3

  • Ability to insert CSS using js
  • Added ability to enable preloader
  • It adds the ability to transfer files, css bottom of the page

1.0.2

  • Pjax requests should not be exclusion
  • Update composer (use mrclay/minify)

1.0.1

  • Add setting cssCompress

1.0.0

  • Stable release

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.3.1.2 is the latest of 18 releases



GPL-3.0+ license
Stats
76 github stars & 25 github forks
10 downloads in the last day
2260 downloads in the last 30 days
30361 total downloads