YUI Compressor 사용방법 / CSS minimize

yui compressor 사용하여 css 나 js 파일을 압축하는 방법

 

아래링크에서 다운로드하여 압축을 해제한 후

다운로드: https://github.com/yui/yuicompressor/releases

사용법은 다음과 같다.
java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js –charset utf-8

java -jar yuicompressor-2.4.6.jar –type css -o sample_min.css sample.css

일괄압축 batch.sh 파일

#!/bin/sh
for file in `find . -name "*.css"`
do
echo "Compressing $file …"
java -jar yuicompressor-2.4.8.jar --type css -o $file $file
done

참고사이트

CSS 미니마이즈 사이트
간혹 아래 사이트에서 압축시 압축이 이상하게 되는 사이트도 있으니 아축후 확인 필요하다.
http://csscompressor.com/
https://developer.yahoo.com/yui/compressor/css.html

cssmin.js


https://www.keycdn.com/support/how-to-minify-css-js-and-html/

스크립트

Batch compress all files in a folder with YUI Compressor


http://stackoverflow.com/questions/13957748/yui-compressor-compress-multiple-input-files-into-one-output-file
http://helexis.tistory.com/entry/YUI-Compressor-%EC%82%AC%EC%9A%A9%EA%B8%B0-1