Created
March 20, 2013 08:51
-
-
Save shinofara/5203239 to your computer and use it in GitHub Desktop.
google製のjs,css圧縮処理(Closure Compiler)を手軽に実行する方法 ref: http://qiita.com/items/a941e394bb3f36bd2d7e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar /usr/bin/compiler.jar --js=aaaa.js --js_output_file=aaaa.min.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar /usr/bin/compiler.jar --js=aaaa.js --js=bbbb.js --js=cccc.js --js_output_file=mix.min.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# minify対象のファイル | |
SRC=aaaa.js bbbb.js cccc.js | |
# minify後のxxxx.min.jsのxxxxの部分 | |
MAKE_NAME=mix | |
# minify後の名前 | |
MINFY_FILE=$(MAKE_NAME).min.js | |
# 一時ファイル作成(aaaa.js,bbbb.js,cccc.jsを結合したファイル) | |
COMBINE=/tmp/js.$(MAKE_NAME).js | |
COMPRESS=$(MINFY_FILE) | |
all : $(COMPRESS) | |
# aaaa.js,bbbb.js,cccc.jsを一つのファイルにまとめてます | |
$(COMBINE) : $(SRC) | |
cat $^ > $@ | |
$(COMPRESS) : $(COMBINE) | |
# まとめた一時ファイルを指定した名前でminify化します。 | |
java -jar /usr/bin/compiler.jar --js=$< --js_output_file=$@ | |
#一時ファイル削除 | |
rm -f $(COMBINE) | |
.PHONY: clean | |
clean : | |
rm -f $(COMBINE) $(COMPRESS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment