Wednesday, 15 May 2013

javascript - Steps to Minify JS and CSS in SVN windows -



javascript - Steps to Minify JS and CSS in SVN windows -

i want compress javascript , css files in codebase,separately.

how can right scratch using yui compressor ? solution steps appreciable .

i need svn windows machine. setup should such when developer runs 2 separate bat files(one js , other css), main files min.js & min.css should compressed.

regards.

from this answer, utilize yui compressor. requires java, run locally batch file , minifies both javascript , css files.

javascript:

java -jar yuicompressor-2.4.8.jar --type js yourfile.js -o yourfile.min.js

css:

java -jar yuicompressor-2.4.8.jar --type css yourfile.css -o yourfile.min.css

the download page here.

to perform these steps on files in directory, set next in batch file (note not work on command line):

class="lang-none prettyprint-override">for /f %%f in ('dir /b c:\*.js') ( java -jar yuicompressor-2.4.8.jar --type js %%f -o %%~nf.min.js )

this minifies files js extension , outputs minified file <filename>.min.js in same directory.

javascript css svn minify

No comments:

Post a Comment