test inlining

This commit is contained in:
Bruno Rybársky 2024-02-04 10:55:12 +01:00
parent e4e10863c5
commit 1d1b31f035

@ -57,9 +57,12 @@ function minifyCss($css) {
} }
function minifyJs($js) { function minifyJs($js) {
// Remove comments // Remove block comments
$js = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $js); $js = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $js);
// Remove line comments
$js = preg_replace('!(//.*)|(/\*.*?\*/)!s', '', $js);
// Remove newlines and tabs // Remove newlines and tabs
$js = str_replace(array("\r\n", "\r", "\n", "\t"), '', $js); $js = str_replace(array("\r\n", "\r", "\n", "\t"), '', $js);