My css js Image Compression batch processing commands

Source: Internet
Author: User
  1   @ Echo off
2 : Set the Yui compressor startup directory
3 Set yuifolder = D: \ yuicompressor - 2.4 . 2 \ Build \
4
5 : Set Your JS and CSS root directories. The script will automatically search for and compress all JS and CSS layers by tree.
6 Set infolder = D: \ jscss \ SRC
7 Set outfolder = D: \ jscss \ build
8 ECHO is searching for Javascript, CSS...
9 Chdir / D % Infolder %
10
11   For / R. % A In ( * . Js * . CSS) Do (
12 Copy % A " % Outfolder % \ " && Echo Replication % ~ Fa succeeded | Echo Replication % ~ Fa failed. Please check whether the file exists !
13 @ ECHO: compressing % ~ A...
14 @ Java - Jar % Yuifolder % \ Yuicompressor - 2.4 . 2 . Jar -- Charset UTF - 8 % ~ Fa - O % ~ Fa
15 )
16 @ Echo css js compression completed !
17
18 For / R. % B In ( * . GIF) Do (
19 @ ECHO: Searching for GIF...
20 @ Pngout % ~ FB / KP
21 Del / Q / F % ~ FB
22 )
23
24 @ Echo GIF conversion completed !
25
26 For / R. % C In ( * . PNG) Do (
27 @ ECHO is searching for PNG...
28 @ Pngout % ~ FC
29 )
30
31 @ Echo PNG compression completed !
32
33 Pause & Exit
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.