diff options
Diffstat (limited to 'www/Makefile')
-rw-r--r-- | www/Makefile | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/www/Makefile b/www/Makefile index a9f86e7..bc48017 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1,28 +1,36 @@ DEPLOY_TARGET="/var/www/imok.ngha.ro/" -PATH := node_modules/.bin:$(PATH) -SHELL := /bin/bash +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash +DEPLOY_CMD := rsync --delete -a -css_out := index.css -js_out := index.js -libs := lib/app.js -styles := styles/app.scss +css_out := index.css +js_out := index.js +css_smap := $(css_out:%.css=%.css.map) +js_smap := $(js_out:%.js=%.js.map) -.PHONY: all clean deploy +.PHONY: all clean build deploy deploy-prod -all: $(app_bundle) +$(js_out): src/app.js + browserify --debug $< | \ + babel --source-maps inline --presets env -o $@ +# uglifyjs -c -m "reserved=['require','exports']" \ + --source-map "content='inline',url='index.js.map',filename='index.js.map'" \ + --output $@ -%.js: - babel $< --out-file $@ - -%.css: +$(css_out): styles/app.scss sass --style compressed $< $@ -index.css: $(styles) -index.js: $(libs) -build: index.css index.js +clean: + rm index.{js,css}* + +$(css_smap) $(js_smap): $(css_out) $(js_out) + +build deploy deploy-prod: $(css_out) $(js_out) -deploy: index.* - rsync -vr $^ $(DEPLOY_TARGET) +#deploy: $(css_smap) $(js_smap) +deploy: $(css_smap) + $(DEPLOY_CMD) $^ $(DEPLOY_TARGET) -all: build deploy +deploy-prod: + $(DEPLOY_CMD) $^ $(DEPLOY_TARGET) |