Yui-compressor installed and used under Linux

Source: Internet
Author: User

Introducing a very popular JavaScript compression tool YUI compressor, can provide better compression efficiency, the tool is produced by the famous Yahoo Exceptional performance project team.

Jsmin is very popular, simple, but according to Yui Compressor's instructions, jsmin compression algorithm is relatively simple, may shed a lot of newline; Yahoo engineer that Yui Library do test, found Yui compressor compression effect than jsmin good 20%; Of course, Yui compressor A disadvantage is based on JAVA, first you need to have a JRE to run, Jsmin provides EXE downloads directly under Windows, and also offers c/java/c#/perl/php/even JavaScript version J for easy use by various programmers in all environments; Download Yui at this address compressor:http://developer.yahoo.com/yui/compressor/

Steps to use:

1. Installing the Java Environment

2. Place Yuicompressor.jar in any directory, such as/opt/software/yuicompressor/yuicompressor.jar

3. Write the bash script, save as Yui.sh

#!/usr/bin/env Bashjava-jar/opt/software/yuicompressor/yuicompressor.jar $ > $

4. Run the command to make yui.sh executable

# chmod +x/opt/software/yuicompressor/yui.sh

5. Create a link

# sudo ln-s/opt/software/yuicompressor/yui.sh/usr/bin/yui

6. How to use

# Yui Old.js New.js

The first parameter is the original uncompressed file, the second parameter is the compressed file

Yui-compressor installed and used under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.