在命令行中 輸入 java -jar yuicompressor-2.4.2.jar --help 會有提示信息,當然,當前目錄下必須有yuicompressor-2.4.2.jar
Usage: java -jar yuicompressor-x.y.z.jar [options] [input file]
Global Options 全局選項
-h, --help Displays this information 幫助信息
--type <js|css> Specifies the type of the input file 壓縮類型
--charset <charset> Read the input file using <charset> 文件使用的字符集編碼
--line-break <column> Insert a line break after the specified column number 在一個指定的列數之后插入一個換行(一般是不需要的)
-v, --verbose Display informational messages and warnings 顯示詳細信息和警告信息
-o <file> Place the output into <file>. Defaults to stdout. 輸出文件,默認為標准輸出
JavaScript Options JS特有選項
--nomunge Minify only, do not obfuscate 僅壓縮,不混淆
--preserve-semi Preserve all semicolons 保留所有的分號
--disable-optimizations Disable all micro optimizations 禁用自帶的所有優化措施
If no input file is specified, it defaults to stdin. In this case, the 'type'
option is required. Otherwise, the 'type' option is required only if the input
file extension is neither 'js' nor 'css'.
如果沒有指定輸入文件,默認為標准輸入。在這種情況下,'類型' 選項是必須的。除非文件名不是 js 或者 css。