💚 개발/웹

YUI Compressor 을 사용하여 .js 파일을 .min.js 파일로 만드는 방법

devshin.kr 2021. 10. 6. 14:20
728x90


1. 아래 사이트에 접속한다.
https://yui.github.io/yuicompressor/

 

YUI Compressor

According to Yahoo!'s Exceptional Performance Team, 40% to 60% of Yahoo!'s users have an empty cache experience and about 20% of all page views are done with an empty cache (see this article by Tenni Theurer on the YUIBlog for more information on browser c

yui.github.io



2. Download 를 클릭하여 다운로드 페이지로 이동한다.



3. 다운로드 페이지에서 yuicompressor-x.y.z.jar 을 다운 받는다. (x, y, z 는 버전명)
https://github.com/yui/yuicompressor/releases

 

Releases · yui/yuicompressor

YUI Compressor. Contribute to yui/yuicompressor development by creating an account on GitHub.

github.com



4. 테스트 경로 내에 origin.js 파일을 생성했다.



5. 다운로드 받은 yuicompressor-x.y.z.jar 파일을 동일한 경로로 옮겨주었다.



6. 다음 명령어를 사용해 min.js 로 만든다. (https://yui.github.io/yuicompressor/)

 

(나는 java를 환경변수로 설정해 두었기 때문에 어느 위치에서든 호출이 가능하다. 환경변수가 뭔지 모른다면 다음 링크를 참고 : MySQL 시스템 환경변수 등록하기)

-o 옵션 뒤에 생성할 파일의 이름인 new.min.js 를 적어 주었다.


7. 생성된 min.js 파일 확인