Created
August 13, 2017 21:41
-
-
Save moll/082bad97e953b584dae97f91291c3b56 to your computer and use it in GitHub Desktop.
Uglify Makefile
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
FILES = $(patsubst %, public/assets/%.js, html5) | |
UGLIFY = ./node_modules/.bin/uglifyjs | |
UGLIFY_OPTS = --stats --mangle | |
minify: $(patsubst %.js, %.min.js, $(FILES)) | |
@for file in $^; do mv "$$file" "$${file%.min.js}.js"; done | |
public/assets/%.max.js: public/assets/%.js | |
@mv "$<" "$@" | |
public/assets/%.min.js: public/assets/%.max.js | |
@echo "Minifying $(@D)/$*.js…" | |
@$(UGLIFY) $(UGLIFY_OPTS) --output "$@" -- "$<" | |
.PHONY: minify |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment