`
dawuafang
  • 浏览: 1192338 次
文章分类
社区版块
存档分类
最新评论

YUI Compressor

 
阅读更多

download:http://developer.yahoo.com/yui/compressor/

==============================================================================
YUI Compressor
==============================================================================

NAME

YUI Compressor - The Yahoo! JavaScript and CSS Compressor

SYNOPSIS

Usage: java -jar yuicompressor-x.y.z.jar [options] [input file]

Global Options
-h, --help Displays this information
--type Specifies the type of the input file
--charset Read the input file using
--line-break Insert a line break after the specified column number
-v, --verbose Display informational messages and warnings
-o Place the output into . Defaults to stdout.

JavaScript Options
--nomunge Minify only, do not obfuscate
--preserve-semi Preserve all semicolons
--disable-optimizations Disable all micro optimizations

DESCRIPTION

The YUI Compressor is a JavaScript compressor which, in addition to removing
comments and white-spaces, obfuscates local variables using the smallest
possible variable name. This obfuscation is safe, even when using constructs
such as 'eval' or 'with' (although the compression is not optimal is those
cases) Compared to jsmin, the average savings is around 20%.

The YUI Compressor is also able to safely compress CSS files. The decision
on which compressor is being used is made on the file extension (js or css)

GLOBAL OPTIONS

-h, --help
Prints help on how to use the YUI Compressor

--line-break
Some source control tools don't like files containing lines longer than,
say 8000 characters. The linebreak option is used in that case to split
long lines after a specific column. It can also be used to make the code
more readable, easier to debug (especially with the MS Script Debugger)
Specify 0 to get a line break after each semi-colon in JavaScript, and
after each rule in CSS.

--type js|css
The type of compressor (JavaScript or CSS) is chosen based on the
extension of the input file name (.js or .css) This option is required
if no input file has been specified. Otherwise, this option is only
required if the input file extension is neither 'js' nor 'css'.

--charset character-set
If a supported character set is specified, the YUI Compressor will use it
to read the input file. Otherwise, it will assume that the platform's
default character set is being used. The output file is encoded using
the same character set.

-o outfile
Place output in file outfile. If not specified, the YUI Compressor will
default to the standard output, which you can redirect to a file.

-v, --verbose
Display informational messages and warnings.

JAVASCRIPT ONLY OPTIONS

--nomunge
Minify only. Do not obfuscate local symbols.

--preserve-semi
Preserve unnecessary semicolons (such as right before a '}') This option
is useful when compressed code has to be run through JSLint (which is the
case of YUI for example)

--disable-optimizations
Disable all the built-in micro optimizations.

分享到:
评论

相关推荐

    yuicompressor-2.4.8.jar

    《yuicompressor-2.4.8.jar:前端优化与代码压缩的艺术》 在Web开发领域,优化前端性能是一项至关重要的任务,而yuicompressor-2.4.8.jar正是这样一款强大的工具,专为JavaScript代码压缩而设计,助力开发者实现...

    yuicompressor-yui compressor

    yuicompressor-2.4.2.jar yuicompressor-2.4.7.jar jsZip.exe yuicompressor yui compressor js压缩工具 javascript压缩工具 css压缩工具 ------------------------------------ //压缩JS java -jar yui...

    yuicompressor-maven-plugin

    **yuicompressor-maven-plugin详解** `yuicompressor-maven-plugin`是一款强大的Maven插件,主要用于优化前端资源,特别是JavaScript和CSS文件。这个插件是基于YUI Compressor,一个由Yahoo开发的开源工具,它能...

    yuicompressor安装文件

    **JavaScript压缩工具——YUICompressor** YUICompressor是一款由Yahoo开发的高效JavaScript和CSS压缩工具。它通过删除空格、换行符以及不必要的字符,有效地减小了JavaScript和CSS文件的大小,从而提高了网页的...

    YUI compressor源码jar包

    1. **可执行文件**:`yuicompressor-2.4.2.jar`是YUI Compressor的一个版本,包含了所有必要的类和资源,可以直接通过命令行进行JavaScript和CSS文件的压缩。只需将这个jar文件添加到系统路径,就可以在终端中运行`...

    yuicompressor

    **yuicompressor** 是一个非常著名的前端资源优化工具,主要用于CSS和JavaScript文件的压缩。它由雅虎(Yahoo!)开发并开源,旨在提高网页加载速度,减少HTTP请求的大小,从而提升整体网站性能。这款工具能够删除...

    yuicompressor.zip

    《yuicompressor:高效能的JS与CSS压缩工具》 在Web开发中,为了提高页面加载速度和优化用户体验,对JavaScript(JS)和Cascading Style Sheets(CSS)进行压缩是一项必不可少的工作。yuicompressor,由雅虎(Yahoo...

    使用yuicompressor压缩及合并js,css静态资源

    java -jar yuicompressor.jar --type js -o script.min.js script.js ``` 这两个命令分别将原始的CSS和JavaScript文件压缩成更小的`style.min.css`和`script.min.js`。`-o`参数指定输出文件名,`--type js`指定了...

    YUI Compressor js css压缩工具

    在提供的文件中,`compressor.bat`是一个批处理脚本,用于调用`yuicompressor.jar`执行压缩任务。使用步骤如下: 1. **环境准备**:确保安装了Java运行环境(JRE)。 2. **运行脚本**:双击`compressor.bat`,或者...

    webstorm_phpstorm_yuicompressor-2.4.8.jar

    1. **下载与安装**:首先,你需要下载"phpstorm-yuicompressor-2.4.8"压缩包,解压后找到"yuicompressor-2.4.8.jar"文件。这是集成的关键组件。 2. **配置File Watcher**:在IDE中,选择`File` > `Settings`...

    js、css 注释清理工具 (yuicompressor)

    为了解决这个问题,开发者通常会使用像`yuicompressor`这样的工具进行代码优化。 `yuicompressor`是由Yahoo开发的一款开源的JavaScript和CSS压缩工具。它通过删除不必要的空格、换行符以及注释,将源代码压缩到最小...

    YUI Compressor压缩JS和Css工具(包含详细配置)

    1. **命令行工具**:通过安装Java Development Kit (JDK),然后下载YUI Compressor的jar文件,可以在命令行中使用`java -jar yuicompressor.jar`命令进行压缩操作。 2. **集成开发环境插件**:许多IDE如Eclipse、...

    YUI compressor

    java -jar yuicompressor.jar input.css -o output.css --type css ``` 在Java项目中,可以将YUI Compressor集成到构建过程,如Maven或Gradle,以自动压缩源代码。 **四、YUI Compressor的局限性** 虽然YUI ...

    YUI compressor右键压缩脚本

    YUI Compressor是一款高效且功能强大的JavaScript和CSS代码压缩工具,由Yahoo!公司开发。这个“YUI compressor右键压缩脚本”提供了一种便捷的方式,使得用户无需通过命令行或图形用户界面(GUI)就能快速对JS...

    YUI Compressor(JS压缩工具)

    **YUI Compressor** 是一个由Yahoo开发的开源JavaScript和CSS压缩工具,旨在减少Web页面加载时间,提高网站性能。它的主要功能是去除代码中的空白、注释,并进行变量名混淆,从而减小文件大小,加快网页加载速度。在...

    yui compressor 2.4.2 javascript/css压缩程序

    java -jar yuicompressor-2.4.2.jar -o compressed.js input.js ``` 对于CSS文件,命令类似,只是扩展名不同。此外,`YUI Compressor` 还支持通过参数配置压缩级别、是否保留注释等选项。 5. **与其他工具的比较...

    yuicompressor-2.4.8.zip js、css注释清理及压缩工具

    `yuicompressor-2.4.8.zip` 是一个前端开发中常用的工具,主要功能是对JavaScript和CSS文件进行注释清理和代码压缩,从而优化网页加载速度,提高用户体验。这个压缩工具出自YUI(Yahoo! User Interface Library)...

Global site tag (gtag.js) - Google Analytics