Skip to content

Commit

Permalink
Variables minifier filter default false
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Sep 19, 2022
1 parent 1c4b301 commit a1b0c9e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
==============

1.4.4
-----------------
* Variables minifier filter default false

1.4.3.2
-----------------
* Fixed option noIncludeJsFilesOnPjax = true
Expand Down
18 changes: 13 additions & 5 deletions src/AssetsAutoCompressComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ protected function _processing(View $view)
//echo "<pre><code>" . print_r($view->jsFiles, true);die;
if ($view->jsFiles && $this->jsFileCompile) {
\Yii::beginProfile('Compress js files');
/*if (YII_ENV_DEV) {
echo "<pre><code>" . print_r($view->jsFiles, true);
}*/
foreach ($view->jsFiles as $pos => $files) {
if ($files) {
if ($this->jsFileCompileByGroups) {
Expand All @@ -270,7 +273,10 @@ protected function _processing(View $view)
}
\Yii::endProfile('Compress js files');
}
//echo "<pre><code>" . print_r($view->jsFiles, true);die;
/*if (YII_ENV_DEV) {
echo "<pre><code>" . print_r($view->jsFiles, true);die;
}*/


//Compiling js code that is found in the html code of the page.
if ($view->js && $this->jsCompress) {
Expand Down Expand Up @@ -354,14 +360,15 @@ protected function _processAndGroupJsFiles($files = [])

$result = [];
$groupedFiles = $this->_getGroupedFiles($files);
/*print_r($groupedFiles);die;*/
foreach ($groupedFiles as $files) {
$resultGroup = $this->_processingJsFiles($files);
$result = ArrayHelper::merge($result, $resultGroup);
}

return $result;
echo "<pre><code>".print_r($result, true);
die;
/*echo "<pre><code>".print_r($result, true);
die;*/

}

Expand Down Expand Up @@ -630,6 +637,7 @@ protected function _processingCssFiles($files = [])
unset($fileCodeTmp[count($fileCodeTmp) - 1]);
$prependRelativePath = implode("/", $fileCodeTmp)."/";

//print_r($prependRelativePath);die;
$contentTmp = \Minify_CSS::minify($contentTmp, [
"prependRelativePath" => $prependRelativePath,

Expand Down Expand Up @@ -664,7 +672,7 @@ protected function _processingCssFiles($files = [])
}

if ($this->cssFileCompress) {
$content = \CssMin::minify($content);
$content = \CssMin::minify($content, [], ["Variables" => false]);
}

$page = \Yii::$app->request->absoluteUrl;
Expand Down Expand Up @@ -703,7 +711,7 @@ protected function _processingCss($css = [])
}

$css = implode("\n", $newCss);
$css = \CssMin::minify($css);
$css = \CssMin::minify($css, [], ["Variables" => false]);
return [md5($css) => "<style>".$css."</style>"];
}

Expand Down

0 comments on commit a1b0c9e

Please sign in to comment.