Skip to content

Commit

Permalink
removed csscrush as it was causing timeouts for some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Crecket committed Dec 14, 2016
1 parent 2c69c35 commit 0253b61
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
],
"require": {
"matthiasmullie/minify": "^1.3",
"doctrine/cache": "1.*",
"leafo/scssphp": "*",
"doctrine/cache": "^1.6",
"leafo/scssphp": "^0.6",
"tedivm/jshrink": "^1.1",
"twig/twig": "^1.23",
"oyejorge/less.php": "v1.7.0.10",
"css-crush/css-crush": "*"
"oyejorge/less.php": "v1.7.0.10"
},
"require-dev": {
"phpunit/phpunit": "*"
Expand Down
14 changes: 10 additions & 4 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Namespace Crecket\DependencyManager;

use JShrink\Minifier;
use MatthiasMullie\Minify\CSS;

final class Response
{
Expand Down Expand Up @@ -219,10 +220,15 @@ public function getCollection()
}

// if result is css, run the file through a auto prefixer
if (isset($this->response_type['css'])) {
$contents = csscrush_string($contents, array(
'minify' => $this->minify
));
if (isset($this->response_type['css']) && $this->minify) {
//create new minifier
$minifier = new CSS();

// add contents to the minfier
$minifier->add($contents);

// get results
$contents = $minifier->minify();
} else if (isset($this->response_type['js'])) {
if ($this->minify) {
// minify js
Expand Down

0 comments on commit 0253b61

Please sign in to comment.