读书人

Google Closure Compiler压缩javascri

发布时间: 2012-11-03 10:57:43 作者: rapoo

Google Closure Compiler压缩javascript代码使用

首先从网上下载代码:

windows系统:http://closure-compiler.googlecode.com/files/compiler-latest.zip

liunx系统:

#wget http://closure-compiler.googlecode.com/files/compiler-latest.zip#unzip compiler-latest.zip
解压后会看到 complier.jar文件,主要引用此jar包进行压缩,使用如下命令进行压缩JS:
E:\google js complier>java -jar compiler.jar --js common.js --js_output_file common_compiler.js
这样就把 common.js 压缩成了 common-compiler.js。

读书人网 >操作系统

热点推荐