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