PHP中的一个简单的javascript / jQuery minifier

时间:2014-04-03 08:26:50

标签: javascript php compression minify on-the-fly

我想使用以下方法压缩我的JS和jQuery代码:

<?php
require_once(dirname(__FILE__).'/minifier.php');
header("Content-Type:application/x-javascript");

//here catching and gzip {...]

//This file will be compressed.
ob_start("minifier");
?>

... here a lot of javascript code ...

我已尝试过jsmin https://github.com/rgrove/jsmin-php/,但它已不再维护了。我更喜欢更轻松的事情......有什么帮助吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

我一直在使用mlitn's package来完成这项任务。

完美无瑕地开箱即用