protected function getAssetic_Filter_UglifycssService() { $this->services['assetic.filter.uglifycss'] = $instance = new \Assetic\Filter\UglifyCssFilter('/usr/local/bin/uglifycss', '/usr/local/bin/node'); $instance->setTimeout(NULL); $instance->setNodePaths(array()); $instance->setExpandVars(false); $instance->setUglyComments(false); $instance->setCuteComments(false); return $instance; }
<?php $uglifyCss = new \Assetic\Filter\UglifyCssFilter('/home/crynick/node_modules/uglifycss/uglifycss'); $uglifyCss->setUglyComments(true); $uglifyJs = new \Assetic\Filter\UglifyJs2Filter('/home/crynick/node_modules/uglify-js/bin/uglifyjs'); $JSqueeze = new \Assetic\Filter\JSqueezeFilter(); $JSqueeze->keepImportantComments(false); $JSqueeze->setSpecialVarRx('(\\$+[a-zA-Z_])[a-zA-Z0-9_$]*'); $lessFilter = new \Assetic\Filter\LessFilter("/usr/local/bin/node", ["/home/crynick/node_modules/"]); return array('filters' => array('.min.js' => array(), '.min.css' => array(new \Assetic\Filter\CssRewriteFilter(), $uglifyCss, new \Assetic\Filter\PhpCssEmbedFilter()), '.js' => array(), '.less' => array($lessFilter, $uglifyCss), '.css' => array(new \Assetic\Filter\CssRewriteFilter(), $uglifyCss, new \Assetic\Filter\PhpCssEmbedFilter())), 'directories' => array('javascripts' => 'assets/javascripts', 'stylesheets' => 'assets/stylesheets'), 'build_path' => 'builds');