YUI Compressor for Sublime text2

Source: Internet
Author: User

YUI Compressor is a tool used to compress JS and CSS files. It is developed in Java. Recently compressed files often use online compression to compress files, which is inconvenient, and can only be shelved if there is no network. This article describes how to use the YUI Compressor plug-in Sbulime text2.

Java installation

Download and Install java on the official website. After installation, configure environment variables:

1. My computer-> right-click Properties-> Advanced System Settings-> Advanced-> environment variables-> System variables:

(1) create-> variable name: JAVA_HOME variable value: C: \ Program Files \ Java (my JDK installation path)

(2) Edit-> variable name: Path to add % JAVA_HOME % \ bin at the beginning of the variable value; % JAVA_HOME % \ jre \ bin

(3) Create-> variable name: CLASSPATH variable value :.; % JAVA_HOME % \ lib; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar to test whether the environment variables are set successfully:

Cd: \ Users \ zuojj \ javac usage: javac <options> <source files> where possible options include-g to generate all debugging information-g: none does not generate any debugging information-g: {lines, vars, source} only generate some debugging information.-nowarn does not generate any warning.-verbose outputs the deprecation of the operations being executed by the compiler.-classpath <path> specifies the process for searching User-Class files and comments

If the preceding result is displayed, the installation is successful.

YUI Compresso plug-in installation

Use Sublime text2 for installation. No more details!

Code compression

After the plug-in is installed, go to the Sublime text2 menu bar-> Tools-> Build System-> select YUI Compressor-> open the CSS or JS file to be compressed (such as a.css) -> (Tools-> Build or Ctrl + B)-> generate the.min.css file in the.css Directory-> compress the file.

Recommended Online (variable) compression and anti-compression tools

1. JS online (variable) compression tool

2. JS online (variable) anti-compression tool

Reprinted statement:

Title: YUI Compressor for Sublime text2

Link to this article: http://www.zuojj.com/archives/1059.html.

YUI Compressor for Sublime text2

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.