Last active
December 25, 2015 15:39
-
-
Save DamonOehlman/6999398 to your computer and use it in GitHub Desktop.
Simple and fairly generic makefile for building a UMDjs distribution for a browserifiable module
This file contains 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
MODULE_NAME=glue | |
REQUIRED_TOOLS=browserify uglifyjs st inotifywait | |
PHONY: dist | |
$(REQUIRED_TOOLS): | |
@hash $@ 2>/dev/null || (echo "please install $@" && exit 1) | |
dist: $(REQUIRED_TOOLS) | |
@mkdir -p dist | |
@echo "building" | |
@browserify index.js > dist/$(MODULE_NAME).js --debug --standalone $(MODULE_NAME) | |
@echo "minifying" | |
@uglifyjs dist/$(MODULE_NAME).js > dist/$(MODULE_NAME).min.js 2>/dev/null | |
serve: dist | |
st --port 8000 --no-cache & | |
while true; do inotifywait -e create -e delete -e modify -q -r *.js node_modules || make dist; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment