Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

Commit

Permalink
create makefile to minify Pourover programmatically using YUICompressor
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffehr committed Oct 7, 2015
1 parent 39610c5 commit 9e100fb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# minify JS but ignore -min.js
JS_FILES = $(filter-out %-min.js,$(wildcard \
dist/*.js \
))

# execute YUICompressor
# be sure to download yuicompressor-2.4.8.jar and put it in your ~/bin/ directory
YUI_COMPRESSOR = java -jar ~/bin/yuicompressor-2.4.8.jar

# flags for YUICompressor
YUI_COMPRESSOR_FLAGS = --charset utf-8 --verbose

JS_MINIFIED = $(JS_FILES:.js=-min.js)

# target: minify
minify: $(JS_FILES) $(JS_MINIFIED)

%-min.js: %.js
@echo '==> Minifying $<'
$(YUI_COMPRESSOR) $(YUI_COMPRESSOR_FLAGS) --type js $< >$@
@echo

# target: clean
clean:
rm -f $(JS_MINIFIED)

0 comments on commit 9e100fb

Please sign in to comment.