Skip to content

Instantly share code, notes, and snippets.

Created October 28, 2010 14:10
What would you like to do?
Windows Batch File to use YUI Compressor easily
@echo off
if "%1" == "" goto error
set jarfile="C:\Program Files\yuicompressor-2.4.2\build\yuicompressor-2.4.2.jar"
set infile=%1
set ext=%~x1
if %ext% == .css set outfile=%infile:.css=.min.css%
if %ext% == .js set outfile=%infile:.js=.min.js%
java -jar %jarfile% -v --charset UTF-8 -o %outfile% %infile%
goto end
echo No Argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment