Web Digest

还有众多网络文摘,仅供个人收藏和参考

Posts Tagged ‘textmate

在Mac上使用Closure Complier压缩Javascript代码

leave a comment »

主流的压缩工具中,似乎是Google的最牛。就用它的了。

现假设已经安装了Text Mate,首先去获取GetBundles工具包。
mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd !$
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/
然后双击GetBundles.tmbundle应该就好了。

然后下载Google Closure Compiler,将其中的complier.jar放到~/Library/Closure Compiler下。

打开Textmate, 进入GetBundles, 然后Search “Google Closure Compiler”,找到后进行安装。

并在Preference中,设置compiler.jar的路径,注意需要使用绝对路径,并且空格前要加反斜杠,比如/User/tiger/Library/Closure\ Compiler/compiler.jar

然后就该一切ok。(还可以设置不同的优化级别,暂时不用那么激进)

新建一个项目,把要压缩的文件拖进去,双击后再⇧⌘G就可以了。生成文件和源文件在同一个目录下。

Written by admin

March 16, 2010 at 10:42 am

Posted in 苹果|Mac

Tagged with ,