From 44ac74b793940dd00b41218d378897ac9b396fa1 Mon Sep 17 00:00:00 2001 From: Anastasia Date: Wed, 4 Jul 2018 13:01:20 +0300 Subject: [PATCH] - add assets autocompress --- frontend/config/main.php | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/frontend/config/main.php b/frontend/config/main.php index 159a354..88db717 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -13,7 +13,7 @@ 'id' => 'app-frontend', 'homeUrl' => '/', 'basePath' => dirname(__DIR__), - 'bootstrap' => [ 'log' ], + 'bootstrap' => [ 'log', 'assetsAutoCompress', ], 'controllerNamespace' => 'frontend\controllers', 'container' => [ 'singletons' => [ @@ -314,6 +314,53 @@ 'rules' => [], 'hideDefaultLanguagePrefix' => true, ], + '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 + ], + ], ], 'params' => $params, -- libgit2 0.21.4