Skip to content

Instantly share code, notes, and snippets.

@jimschubert
Created September 29, 2011 02:12
Show Gist options
  • Save jimschubert/1249824 to your computer and use it in GitHub Desktop.
Save jimschubert/1249824 to your computer and use it in GitHub Desktop.
Minify your .js files using uglify-js (expressjs)
JS = $(shell find public/javascripts -type f \( -iname "*.js" ! -name "*.min.js" \) )
MINIFY = $(JS:.js=.min.js)
all: clean $(MINIFY)
clean:
rm -f $(MINIFY)
%.min.js: %.js
node ./node_modules/uglify-js/bin/uglifyjs -o $@ $<
.PHONY: clean js minify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment