forked from Adleraci/adlerka.top
test inlining
This commit is contained in:
parent
169afc4ba5
commit
17992f3e16
@ -57,17 +57,12 @@ function minifyCss($css) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function minifyJs($js) {
|
function minifyJs($js) {
|
||||||
// Remove block comments
|
|
||||||
//$js = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $js);
|
|
||||||
|
|
||||||
// Remove line comments
|
|
||||||
$js = preg_replace('/\/\/(?![^\'"]*(\'|")[^\'"]*(\'|"))[^\n]*/', '', $js);
|
|
||||||
|
|
||||||
// Remove newlines and tabs
|
// Remove newlines and tabs
|
||||||
//$js = str_replace(array("\r\n", "\r", "\n", "\t"), '', $js);
|
$js = str_replace(array(" ", "\t"), '', $js);
|
||||||
|
|
||||||
// Remove spaces around operators
|
// Remove spaces around operators
|
||||||
$js = preg_replace('~\s*([=+\-*/])\s*~', '$1', $js);
|
//$js = preg_replace('~\s*([=+\-*/])\s*~', '$1', $js);
|
||||||
|
|
||||||
return trim($js);
|
return trim($js);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user